2

How would i go about retrieving the referring url with either PHP or apache.

I know about $_SERVER['HTTP_REFERER'] which you cant use or trust.

I have found you can get it in javascript with document.referer

But if JS is disabled it wont work, I would prefer not to use JS.

I have been trying to see if that is the only way to do it and looked into bit.ly, they do not use JS.

Is there a way to use Apache logs to find this information or another programming language, completely at a loss as to how i can get this simple bit of information.

Tamer Shlash
  • 9,314
  • 5
  • 44
  • 82
Blu Towers
  • 1,908
  • 4
  • 17
  • 20
  • Possible duplicate: [This](http://stackoverflow.com/q/165975/368167) and [This](http://stackoverflow.com/q/1864583/368167). – Tamer Shlash Jan 01 '12 at 11:26
  • Not really duplicating as read all i could find, i was stating that i know about the http_rerefer and JS techniques i was wondering/hoping there was an apache or other technique, maybe using the apache log files ect. – Blu Towers Jan 01 '12 at 11:37

1 Answers1

2

Apache is going to log the same information as you see in $_SERVER['HTTP_REFERER']. What makes $_SERVER['HTTP_REFERER'] unreliable -- in my understanding -- is that not all user agents send the referer, which is something that Apache won't be able to get around either.