On most sites (including this one) the 404 page that Apache spews out when someone hits a bad page is a pretty standard one, static with a few links - nothing much special about it. But, DevArticles.com has a different opinion on what a 404 PHP-based page should be. In their latest article, Trap And Get Notified: A Practical Solution To 404 Errors With PHP, they show you how to craft a 404 page fit for a king - one that will notify you when someone hits a bad page, what the page was that they were looking for and email it all to you for your records. This can be especially useful on a site that has a lot of content that might move around, or a site that just redesigned and wants to see where people are hitting the most.
They give you all the code you'll need to make this work, including the .htaccess file to help you catch these errors (404, 403, 500, etc...).




