I use my .htaccess file to redirect visitors with errors to my custom error pages.
The server is an Apache with PHP 5.2 so I code in PHP.
I wish to know, on my PHP error pages, what page did the visitor request and gave an error?

Accepted Answer

$_SERVER['REQUEST_URI']

or

$_SERVER['REDIRECT_URL'] 

should give you the information.

Written by Dr.Molle
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki