Get HTTP Referrer on Redirection

MacMac picture MacMac · Oct 28, 2010 · Viewed 16.5k times · Source

How can you get the HTTP Referrer when redirected from another website, not when they click on a link since it would work for $_SERVER['HTTP_REFERER'], but it doesn't work when a user has been redirected a website and the referrer would be empty.

What will be the method to get the referrer?

Answer

Pekka picture Pekka · Oct 28, 2010

How can you get the HTTP Referrer when redirected from another website

You can't. If the redirection takes place under your control, you can add the original referer as a parameter, but if the external redirector doesn't do that, you have no way to get hold of the information.