Custom Error Pages

I’ve had custom error pages on my site since it started, but today I added an awesome feature. It was great that the user was getting an error page with the same look and feel as my site, but I wasn’t getting any information from it.

I’ve added some PHP scripting so that whenever someone gets one of my error pages, I am sent an email with the URL they were trying to access, the referring page that has the broken link, time, date, visitor’s IP address. Now I’ll be able to track down broken URLs and resolve them.

Mr Bob’s Web Design has a great code generator and instructions for setting this up. When you do step 2, make sure to remove any blank lines at the end of functions.inc.php after pasting the code into it. If you don’t, you will get an error message on your error pages that the headers have already been sent.

2 Comments

  1. Posted January 24, 2004 at 3:39 pm | Permalink | Reply

    This is SWEET! I’ve already found and fixed several scripting errors on my site that were creating links to pages that didn’t exist. I highly recommend this scripting for your error pages.

  2. Posted March 23, 2005 at 10:36 am | Permalink | Reply

    sWeeet!

    Thanks for passing this along. Great script.

    PS – I enjoy your site :-)

    Tj

One Trackback

  1. By more on Custom Error Pages at Mission: Communicate on January 14, 2006 at 10:47 am

    [...] I found this page quite useful for customizing the wp-404 template. MtDewVirus » Custom Error Pages [...]

Post a Comment

Required fields are marked *

*
*