2

I have this scenario: https://site1.com has a link to http://site2.com which auto redirects to http://site3.com using PHP Header Location. The user clicks on the link in site1 and ends up in site3.

As expected, the referrer is not passed from site1 to site2 (HTTPS to HTTP) but I would expect that on site3 I should have as referrer site2 (both being on HTTP). There is no referrer information on site3.

Is this normal or am I doing something wrong? I use PHP's $_SERVER['HTTP_REFERER'] to read the referrer info.

Octav
  • 122
  • 9

1 Answers1

0

sYou can't rely on 'HTTP_REFERER' being there as it is stripped out by some browsers and most security software. I have a similar issue detecting which search engine traffic has come from.

I would pass the referring URL as a parameter on the URL for site 2 & 3, that way you can guarantee it is there.

Aman Kumar
  • 480
  • 2
  • 7
  • 21
Horaland
  • 857
  • 8
  • 14