Created
September 7, 2012 08:29
-
-
Save bitbonsai/3664344 to your computer and use it in GitHub Desktop.
Proactive 404
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$http = str_replace('HTTP/1.1','http://',$_SERVER['SERVER_PROTOCOL']); | |
$datetime = date('Y-m-d H:i:s'); | |
$to = $config['webmaster']; | |
$subject = '404 at '. $config['url']; | |
$headers = 'From: site@'.$config['url']."\r\n"; | |
$message = <<< MAIL | |
Date/Time: {$datetime} | |
The following URL fell on 404: $http{$_SERVER["SERVER_NAME"]}{$_SERVER["REQUEST_URI"]} | |
Redirect Url: {$_SERVER["REDIRECT_URL"]} | |
Referrer: {$_SERVER["HTTP_REFERER"]} | |
User Agent: {$_SERVER["HTTP_USER_AGENT"]} | |
Accept-Encoding: {$_SERVER["HTTP_ACCEPT_ENCODING"]} | |
Cookie: {$_ENV["HTTP_COOKIE"]} | |
Please fix it. | |
Sincerely- 404 Robot | |
MAIL; | |
@mail($to, $subject, $message, $headers); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment