March 13th, 2000, 07:34 PM
I'd like to add a feature to my 404 script to get the url that caused the error. I already have the URL of the refering page, but is it possible to determine the incorrect URL that was used to cause the error?
Thanks in advance,
March 15th, 2000, 05:08 PM
it think it depends on the used server. I can get all the needed information via apache.
the function shows you the servergenerated variables.
Hope this helps you.
March 20th, 2000, 06:28 AM
If you use Apache as your webserver it's pretty straight forward.
1) Make sure your 404 page is allowed to execute php-scripts (check your srm.conf file (eg. /etc/httpd/conf/srm.conf) set it to eg. /missing.php3 . Then you make DOCUMENT_ROOT/missing.php3 your 404 page)
2) The requested url can then be found with the command:
Hope this helps you a bit
March 20th, 2000, 06:48 AM
Right now I have the error redirection set using ErrorDocument 404 in the .htaccess file, so the script always thinks the REQUEST_URI is its own path (because you are redirected to it with a new REQUEST_URI). I'll see about trying your solution. Thanks for your help.