PHP predefined variables and URLs
November 14, 2007 5:10 AM
Subscribe
I'm developing a custom 404 page using .htaccess to redirect to the 404.html. I'm trying to use PHP (via an include in the 404.html) to show the referring page (using $_SERVER['HTTP_REFERER']). This works fine. I'd also like to return the bad URL that originates the 404. Is this possible using PHP?
I've reviewed the documentation at php.net regarding predefined variables but I'm not seeing what I want. If it's not possible via PHP is it possible using any other technology? If so, any suggestions? I do not have access to the server configuration BTW.
Thanks.
posted by lyam to technology (6 comments total)
(I assume you're not actually doing an HTTP redirect, just rewriting the URL to point to 404.html internally? Otherwise the current page would be 404.html and the referer would be the page originating the error)
posted by malevolent at 5:57 AM on November 14, 2007