Script: friendly error pages using PHP and .htaccess

domesticat's picture

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.

Blaine Hilton's picture

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!
gfmorris's picture

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

Post new comment

User login

Recent comments

  • Anonymous 2 days 18 hours ago [view]
  • Anonymous 2 days 19 hours ago [view]
  • Anonymous 2 days 20 hours ago [view]
  • Anonymous 2 days 20 hours ago [view]
  • katre 2 days 21 hours ago [view]

Search

Hello, anonymous!

If you're seeing this, you're not logged in. A lot of content here is only visible if you're logged in, and comments by anonymous users are held for moderation. Consider getting an account to save yourself some frustration?

domesticat.net

is the home of Amy Qualls-McClure since 2000. She is a Drupal / quilt geek in Huntsville, Alabama. One spouse, two cats, no kids, lots of opinions.

Public account for work and Drupal stuff: Private account for friends and personal life:

me on plurk me on drupal.org my music habits on last.fm my photos on flickr my bookmarks on del.icio.us my bookmarks on pinboard.in Amy Q. on foursquare what I'm reading

Some content is locked. Copy these links AFTER logging in for a query string giving you full feed-reader access:

Atom feed, entries RSS feed, entries RSS feed, comments