Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-includes/theme.php on line 623
PHP one liner for error404.php | Warcraft III World Editor Tutorials Map Making Help Blog

Google Translate:

Script by 3ICE.

Categories

Archives

Affiliates

  • 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>404 Error: Document Not Found!</title></head><body><?php mail("your@email.com","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: error404-3ice.hu@example.comrn"); ?></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>
    <p></body></html>

    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 "your@email.com" 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 "error404-3ice.hu@example.com" 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

WP_Cloudy

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.