Skip to content

A podcast for those who design, develop and run websites.

Boagworld is the personal website of Paul (the Wurzel) Boag who lives in the heart of rural Dorset. He produces a weekly podcast along with Marcus (pop star) Lillington on all things relating to building and running websites.

Latest shows

127. Context
In this week's show we discuss taking context into consideration when designing websites and we answer your questions about video for an elderly audience and the most influential books in the industry. 
126. Scaling
In this weeks show we learn lessons from the botched iPhone launch here in the UK. We chat to Jeff Veen about the designer / developer relationship and Marcus talks about adding jingles to your website.
125. Copy
In this weeks show we discuss how to give personality to your site copy and we talk with Elliot Jay Stocks about going freelance.
124. HTML 5
In this weeks show we explore how to create better online surveys and Lachlan Hunt joins us to discuss HTML5
123. Plight
In this weeks show we review Textmate and the Top 5 Tips for Web Designers and we discuss the plight of in-house designers.

or view all shows

Have your say

Leave a message for the show...

Buy my book: The website owners manual. A book for all those involved in designing, developing or running websites on a daily basis.

Handling missing pages

Published on: August 2, 2004 by Paul Boag

No matter how well built your website is there is no avoiding the fact that sometimes the page a user is looking for just can't be found. What matters is how you handle the problem when it occurs.

When a page cannot be found it generates something called a 404 error. This is usually shown to the user as an unfriendly generic web page generated by the browser itself. It does nothing to help the user find the content they are looking for and in many cases doesn't even give them a decent explanation as to why the page didn't appear in the first place.

What causes a 404 error?

404 errors can be caused by a number of factors. Some of the most common reasons include:

Pages being moved

Reorganisation of a web site is a common practice and one that often leads to broken links. Sometimes these can be links internally which were missed in the update, however more often than not they are external links from search engines or third party web sites that become out of date.

Mistyping

Where web site addresses appear in printed form it is neccessary for users to retype them into a browser. Unsuprisingly this can sometimes lead to mistakes being made and a 404 error being generated.

Designing the perfect 404 error page

As with all web design there is no perfect way to build a 404 error page. However there are some general principles that you may well wish to take into account:

Avoid redirecting

Many sites choose to redirect users to the home page instead of displaying a custom 404 error page. This can prove hugely confusing. Take for example this web site, imagine you had arrived on this site following a link to a specific article. If I had removed the article it would be confusing to find yourself redirected to the home page which would display totally different content to that which you had expected.

Make it obvious what the page is

It is important to make this page stand out. It needs to be made clear to the user at a glance that they have not been taken to the page they are expecting and how they should go about overcoming this problem. The design should be minimalistic while still containing the navigation and branding from the rest of the site.

Offer a site map

A site map helps a user gain a quick understanding of the overall structure of the site they have arrived at. It provides a context that should help them quickly and easily find the content they are looking for.

User friendly terminology

As somebody responsible for your web site I am sure you know what a 404 error page is (at least you do now you have read this article), however that doesn't mean your average user does. Avoid using the term 404 error when creating your custom page. Rather explain that the page cannot be found in as an apologetic way as possible. Avoid giving the user the impression that you consider it their fault they can't find what they are looking for.

Make sure the user can search

If you have an internal search engine use it. There really is not much more to say on this point. It's a not brainer really. This will help users quickly and easily find what they are looking for on the site.

Conclusions

The web is a hard enough place to navigate anyway, without the further confusion of pages dissappearing when you try and access them. An intuative, well considered 404 error page makes a big difference to the usability of a web site. However avoiding the error in the first place is even better. Where possible fix broken links that occur. If the page has simply moved try setting up redirects to the new page or ensure the link is updated. Don't see a 404 error page as a quick fix to fundermental problems with your site.

Comments

Comments are for the discussion of this post. If you have other questions / comments then post them to the forum or send me an email

  • Post by Tom Miller on February 11, 2007 5:31 AM

    Tip: Tracking 404 Pages

    Besides telling you from which sources your site traffic originates, Google Analytics also tracks just about any activity that occurs on your site, including popular navigation paths, plus track downloads, outbound links, and activities on cross-domain properties. But one shortcoming is the lack of reporting on 404 pages, which appear when there's no file or page that corresponds to the visitor's request. For example, sometimes visitors will type in a filename that they think is available on your site, or sometimes your site might have a obsolete link which routes to a deleted or non-existent file or directory. In both cases, a 404 or "Not Found" error page will appear on the browser.

    It's valuable to see these requests so you can learn what visitors are looking for, and consider adding new content or fixing the broken link.

    Reporting on missing or error pages requires a few steps:
    1. Add the Google Analytics tracking code to a custom 404 error page

    2. Modify the tracking code on the 404 page as follows (see the urchinTracker modification in red below):

    _uacct = "xxxxx-x";urchinTracker("/404.html?page=" + _udl.pathname + _udl.search);
    This code sends a virtual pageview of "/404.html?page=[pagename.html?queryparameter]" to your account, where [pagename.html?queryparameters] is the missing page name.

    3. Look for /404.html in your Top Content report. Or to make it easier open the Dynamic Content report and expand the list for "/404.html."

  • Post by Slava Slavik on March 6, 2007 10:45 PM

    Good point, Tom, but is there a way to find out the name of the requested page not found in JavaScript or PHP? I would prefer storing it in a a special log file than running a script on another server.

  • Post by Slava Slavik on March 7, 2007 5:18 AM

    Please, disregard my previous post. I found a good tip on logging 404 requests here:
    http://tips-scripts.com/?tip=not_found#tip

  • Post by Ian Gray on August 8, 2007 4:36 PM

    Thanks for this, Paul. I found the article on the A List Apart website quite useful by Ian Lloyd- http://www.alistapart.com/articles/perfect404/

    I've been working on getting a 404 page right for a website recently. I've used php to implement a version of Ian Lloyd's example. I think it's better to use a server side solution as what if the visitor has javascript disabled?
    I won't jibber on here about it, but a question I have is, is there a better way of describing a URL? Most people don't really know what a URL Is. Would you describe it as a web address? Any ideas? I'm trying to make my 404 as user friendly as poss!

Leave a comment

Additional Information

Supporting boagworld

Boagworld only exists thanks to the kind support of the following people. Check them out.

Speaking and writing

Supported by feed.informer.com