I am using the ErrorDocument directive in an .htaccess file to redirect users to custom error pages (PHP script) on my site. In my PHP script I am able to capture the bad URL using $REQUEST_URI and make it the value of a hidden field in a form. The user can than submit the information if they beleive it was truly an error and not just a mistyping. What I would also like to do is capture the page where the URL was linked from so that I can troubleshoot the problem. Is there a way that I can do this? I have looked for a javascript solutions and could not find anything.
TIA