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.

all tags: 

Comments

Nic set of scripts there, I think I'm going to use them on my WebCalc site. I've been thinking for awhile now that I really need to create somekind of error logging because the site is quite large and always growing. Being a pretty lazy person however I haven't got around to it yet and now I don't have any excuses!

Oooooooooooooooooooooh, nice. /me plans to download and use this later.