404 Email Alert Page Script
Free Online Resource
Here is the 404 page Email Alert Script that I made / use.It sends an email to you (the owner), when a 404 error is triggered on your website.
This is so awesome because you get a detailed email immediately when for instance...
- You may have just sent out a broadcast email and stuffed up the link and wondering why no-one is taking action on your email, and where you would normally not know about it until someone complained.
- You have a theif that is fishing through your website looking for your download page or information that you don't want them to have unless they buy of course.
- You have a legitimate broken link where normally if you're lucky someone will report to you
This is what the email you get looks like...
404 Error has been detected!! *** DATE OCCURRED 18 Jul 2006 10:30:07PM *** FAILED PAGE REQUEST URI script-smart.com/test *** IP/HOST 210.49.77.35 *** USER AGENT Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 *** REFERER empty *** REQUEST METHOD GET Visitor was then redirected to http://script-smart.com
This script is a PHP solution.
Don't worry it's completely spam hijacking proof, so no spamming robots will hijack it.
Click Here To Download The Source Code (Downloads: )
It's setup really easy to change the variables. You just need to change a few variables and it'll work for you.
There are 2 files.
- 404.php - this is main brains which creates the email and sends it you when this page is called
- .htaccess - this is a simple HTACCESS file, which simply tells the server if it gets a 404 error to use the 404.php to display the error
These 2 files must go into your root directory of your web space. (for example, in most Linux setups you should put this into /public_html directory)
WARNING : If you already have a .htaccess file in your root web directory, then DO NOT overwrite it, it may contain needed information that you have previously setup from the control panel, like Frontpage extensions. You will then need to merge the code from the .htaccess in the ZIP that you downloaded and the .htaccess file already in your hosting account.
.htaccess is a *nix solution, and if you have a windows box then you need to edit your custom error page section of your control panel to point to the 404.php file. You may have to ask your host how to do that. But it's definately worth the effort to get this script going.

Enjoy
I'd love to know if you get good use out of the scripts so drop me a line here ... support@script-smart.com
Thanks
Aaron Dwyer
Script Smart - Your Script Toolbox
http://script-smart.com