Hi everybody, I have a question, and I'm not sure there is a good answer, but I wanted to toss it out there and see. What I'm trying to do is use PHP to redirect from page A to page B, but I want the referrer in the HTTP headers to be set to page A (the page that performed the redirect). From what I can tell, a 301 redirect passes referrer information, but it completely bypasses the redirect page. A 302 redirect drops any referrer information. Is there any way (outside of META and Javascript redirects) to perform a PHP redirect and set the redirecting URL as the referrer? Thanks, Tyson
The referer is set by the browser but browsers are not required to send referer information. There is no way you can control this mechanism from PHP so you will have to use another method. If the redirect is within the same domain you could use a cookie mechanism. The other option is to pass it as a (urlencoded) GET parameter. In both cases you can perform the redirect by sending a Location header: ... header("Location: $url"); ... Code (markup):