404 Error Customization--Server Side Part

I know you can change your .htaccess to have your 404 error display the page you typed in at the top (in the address bar)

How do you do that?

(Hehehehe, I love my 404th post)

<?php
$location = "http://" . $_SERVER['HTTP_HOST'] .  $_SERVER['PHP_SELF'];
echo $location;
?>

that’ll give you your current location, then if you just want the file take out what you don’t need of course :wink:

In case you’re asking about the .htaccess file instead of the CGI side of things (or for reference for anyone else), the line is:

ErrorDocument 404 “/404.php”

You can replace ‘404’ for any HTTP error code (403, 401, 500 would be good choices), and replace ‘404.php’ with the actual filename of the script you want to handle the printing…