View Full Version : does php redirect pass referrer?
cherry_yuya
Dec 3rd 2007, 5:28 am
Does php redirect pass referrer?
<?
header('Location: http://www.SITE-C.com');
?>
For example when visitors from site A visit Site B, then Site B (php redirect) redirects to Site C. Does site C see site A as referrer?
Thanks
nico_swd
Dec 3rd 2007, 5:32 am
No, your browser passes it. (Some browsers don't)... And that's why you can't rely on it.
cherry_yuya
Dec 3rd 2007, 11:46 am
So you mean sometimes Site C will see blank as referrer and sometimes Site B but never Site A?
l3vi
Dec 3rd 2007, 12:37 pm
The PHP header Location will not change the referral. The browser will hit it and jump forward, thus as if it skipped the file and will reference the page before that as the referral.
cherry_yuya
Dec 3rd 2007, 1:55 pm
What about this?
<?
header( 'refresh: 0; url=http://google.com' );
?>
Jean-Luc
Dec 3rd 2007, 2:44 pm
So you mean sometimes Site C will see blank as referrer and sometimes Site B but never Site A?That's not correct. Site C will see site A as referrer.
Jean-Luc
tonybogs
Dec 4th 2007, 4:06 pm
nico_swd is correct, some browsers will pass this others will not.
In my experience more often than not the referrer will not be site A.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.