Script: friendly error pages using PHP and .htaccess
Jeff asked me the other night, "How do I get those friendly error pages like what you've got on domesticat?" I told him how, and helped him get set up, and realized along the way that such a package, while pretty simple overall, could be interesting to other people.
This package is not terribly spiffed-up. It's small, and clean, and simple. The only real feature to it, aside from the actual existence of the friendlier pages, is the logging function I've dropped in. Many log analysis software packages (like webalizer, which I use) don't have very robust error-tracking bits…sometimes it's difficult to figure out where your 403, 404, and occasional 500 error messages are coming from.So - if you're interested in that sort of thing, you can use the logging function to generate an error log for whichever errors you want to track. The files will be pipe-delimited (that's a | for the rest of you); they should be easy to import into a spreadsheet program like Excel, for those of you who want to do some data tracking.
These files require PHP, and the ability to use .htaccess files in your website. There's a readme text file included in the package that will provide you with full directions on how to get these pages up and running.
Questions or comments - add them below.
You can download the file here.