Google Translate:

Script by 3ICE.




  • 21Dec

    Copy and paste this into an error404.php file hosted on your PHP-enabled web server:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html><head><title>404 Error: Document Not Found!</title></head><body><?php mail("","404 report: ".getenv("REQUEST_URI"),getenv("SERVER_NAME").getenv("REQUEST_URI")."nFrom: ".getenv("HTTP_REFERER")."n".getenv("REMOTE_ADDR")." &bull; ".getenv("HTTP_USER_AGENT")."n".date("D M j Y g:i:s a T"),"From:"); ?></p>
    <h1>Error 404: Document Not Found!</h1>
    <p>The <code><?php echo getenv("SERVER_NAME").getenv("REQUEST_URI") ?></code> page was not found on this server.</p>
    <hr />
    <p style="text-align:right">Date: <?php echo date("D M j Y g:i:s a T") ?></p>

    Insert this line into the end of your .htaccess file in the root directory of your public html folder:

    ErrorDocument 404 /error404.php

    (Valid XHTML!) And don't forget to change "" to your real email address. You will get a new email every time someone tries to access a broken URL on your site. The sender is "" by default, but you can change that easily in the PHP script.

    The report includes: Broken URL, URL where the visitor came from, IP address of the visitor, UserAgent of the visitor, and Time of the visit.

    Posted by 3ICE @ 5:28 pm

2 Responses


Leave a Comment

Please note: If you post more than 5 URLs, then automated moderation will delay your comment for investigation. There is no need to resubmit the comment as it will be approved if found to be appropriate.