Surfer is coming from A to B. At B, there's a PHP redirect to C. Site B redirects to C, without giving C referrer information. Site C sees Refferrer field as blank. I'd like site C to see site B as a Refferrer. Thanks!
Why not pass the referer as a parameter to site C? This assumes that site C is PHP that can recieve the parameter. For example: www.SiteB.com redirects to www.siteC.com?ref=www.SiteB.com Cryo.
I'm taling about the regular referrer field that is in Apache logs and stuff. I need that NOT to be empty. It is currently when I'm doing a redirect like described.
This is what I've done in a similar situation and what Cryo was pointing at (I think) <?php header('location: http://www.domain.com/page.php?var='$varvalue); ?> That way you can pass information through the query string, e.g. on your next PHP page you can do: $varvalue=$_GET['varvalue']; hope that helps.
Site C is not under my control and I don't even know if it's using PHP or not. I need the standard httpd referrer field set so it will be server C's logs.
The problem is actually caused by the Browser. When it receives the redirect message from Site B, it is failing to send the correct Referer header to Site C. Different browsers may behave differently. You code was doing a 302 redirect. Perhaps a 301 redirect would work better for you... header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.SITEC.com'); PHP: Let me explain: A 302 redirect is Temporary, and a 301 redirect is Permanent. Some search engines dislike the 302 temporay redirect, and so the general advice is to use a 301 permanent redirect when possible. You may also find that the 302 permanent redirect might pass along the referrer (I'm not sure). Cryo.
Which browsers have you tried? I have to admit, I haven't got a clue why the referer isn't being passed. Perhaps it's just how it is defined in the HTTP standards.
Instead of using headers, have you tried sending a page that 'auto submits' itself to the page you want them to end up at? That might do it...
From site B, return a page something like: <html> <body onload="document.getElementById('submitbutton').submit()"> <form action="the_url_of_site_c"> <input type="submit" name="submitbutton"> </form> </body> </html> Code (markup):
Good thinking. Alternatively, use a meta refresh: <!-- Redirect to another webpage/website after a given time period (in this case 10 seconds) --> <meta http-equiv="refresh" content="10;url=http://www.wikipedia.org/"> HTML: Should have the same effect as the javascript, but will work for everyone. It's customary to add a ordinary link for the user to click on if the redirect doesn't happen automatically. Both methods should result in the correct refer being passed on. Cryo.