Hi Sean,
URL of the page that wasn't found:
$_SERVER['REDIRECT_URL']
Query string submitted to the page that wasn't found:
$_SERVER['REDIRECT_QUERY_STRING']
URL that referred the visitor to the page that wasn't found:
$_SERVER['HTTP_REFERER']
The above probably won't work if your site is configured to *redirect*
requests for non-existent documents to the error page--that is, if it sends
a redirect header to the browser pointing to /missing.php. When the user
visits a "real" error page (vs. a redirected to on error page), they are not
redirected--the error message is displayed at the bad URL. To configure
things as such with Apache, insert:
ErrorDocument 404 /scripts/not_found.php
into .htaccess (assuming your server's config allows that directive in
..htaccess).
Have a great day!
Ben :-)
Ben Gribaudo - Baltimore, MD -
www.bengribaudo.com
"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16
"Sean Pinto" <sp****@virtualslo.com> wrote in message
news:a0**************************@posting.google.c om...
My hosting company has an automatic redirect page called
/missing/missing.php and I want to log all of the page not founds that
result in a redirection to missing.php. I can't seem to find out how
to get the string that the web user typed to get there. I have
checked $_SERVER['REDIRECT_URI'] but it has /missing/missing.php and
$_SERVER['HTTP_REFERER'] is empty. Does anyone know how to get
"/abcdef" if the user navigated to "http://mydomain.com/abcdef" ? Any
help is appreciated.
Thanks,
Sean