Ever encountered a "404 error" message on a site? Also known as a "page

not found" error, it can really annoy visitors. Some of these folks may never

return to your site. If you don't handle these people with care, you could drive

important traffic away from your site. Now, you really don't want to do that,

do you?

Links go "missing" for a whole bunch of reasons:

  1. You moved the page elsewhere. Instead of grouping "mutual funds"

    under "Investments", perhaps you moved it to "Personal Finance"

    (for example)
  2. Some other site linked to a page on your site. Either they got the link

    wrong or the linked page no longer exists (tip: please´┐Ż try not to re-architect

    your site unless absolutely necessary).
  3. A search engine still maintains an old index of your site and hasn't updated

    it in years.
  4. Somebody made a minor mistake typing the URL in e.g., product.htm instead

    of product.html

But that's no reason to allow visitors to leave disappointed! Every site must

have a custom "404 page" that tries to help people find what they

thought they'd find. Experienced web developers (of whom there are lots on the thelist) know that such a page is essential for a large, high-traffic site. Or at least they

ought to. If that's the case, why do some of the most popular sites on the Internet

not have one? Here are some examples...

... and still more well-known sites have practically useless 404 error pages.

Some examples are:

Very few sites actually trap the URL causing the problem and

allow people to enter it into a form without copying, pasting, pressing the

Back button to check the referrering page, etc. Why is that so hard? Instead of asking questions

like "Write to us, telling us what URL caused the problem, where you came from,

what operating system and browser you're using", why not just sniff all this

through a server-side script and use that info? See: http://www.ask.com/AnErrorPage.html

as an annoying example.

Don't drive people away. Here are some ideas for designing more user-friendly error pages::

  1. Don't redirect them automatically to the home page! This is evil!
  2. Show a friendlier error message. Use a more informal tone. "Oops! We couldn't

    find this page for you. Try these options:" sounds a lot better than "Error.

    Missing page".
  3. Offer a link to the site map, or better still, reproduce the site map on

    the error page. This will help those users that might have been just looking

    for a particular section, say, the "Services" page.
  4. Offer a link to the site search. Better still, put a search form right

    there on the error page. It's good to try and minimize the number of clicks

    for a visitor.

    Offer a link to a guided tour (if you have one) or the "About the site" page.
  5. Trap the refererring page (Use the "HTTP_REFERER" server variable) and

    automatically send an email message to the Webmaster of the site, notifying

    him/her of i) The URL with the error and ii) The referring page
  6. On the custom 404 page, have a contact form that the user can fill in if

    he/she was looking for something specific. For a particularly nice touch,

    pre-fill the "Missing page:" field with the URL of the page that caused the

    error, and the "Referring page:" field with the URL of page they came from.
  7. Please reply promptly to all mail from users who got a 404 page. Don't

    stop at the autoresponder (you do have one, don't you?). Write back to them,

    tell them how to find what they were looking for, and do it within 24 hours

    of the error. Prompt customer service is so rare on the Web that it will really

    be appreciated by your visitors.

Using some or all of the above measures will spread that "they really

care about me" feeling amongst your site's visitors, and we all know that

trust is a scarce commodity on the Web.

Are there any decent 404 pages out there? Yes. Here are a few:

More resources

  1. ASPToday has a detailed article

    about setting up custom 404 error pages on Windows NT
    . If you're on NT,

    read this.
  2. ASP 101 has a good

    ASP script
    that traps the referring page and sends a mail to the Webmaster

    about the error. You could modify this to log it to a database instead.
  3. As Martin points out below, Anthony has written an article

    about doing the same for Apache
    on Unix/Linux.
  4. The 404 research lab is a site

    devoted to just 404 errors. Highly recommended. Includes examples of good

    404 pages, whacky pages, instructional pages, etc.