I am afraid the other answer is completely wrong and misleading.
Cannot be redirected to a page with custom headers, no matter which language or frame you use. In other words, there is no way to trigger an HTTP redirect and force the client (browser) to add a custom header.
Perhaps you think this code should work fine:
return redirect('http://www.anydomain.com') ->header('customvalue1', $customvalue1) ->header('customvalue2', $customvalue2);
But this is not so. You set up custom headers for the response that instructs the browser to redirect, not for the redirect itself.
The only way a site can tell the browser to send an HTTP request using a custom header is to use Javascript and an XMLHttpRequest object. And to implement such ajax requests, he needs CORS on the target server.
Note that a page cannot set headers for HTTP requests if it does not make an async request using XMLHttpRequest . This means that you cannot redirect with a custom header on the client side.
This is not how the web works.
source share