The importance of 404 Pages

404 pages are an essential part of the functionality of a website. They are often ignored, because they are, in essence, a page that should never be seen.

Why do anything with 404 pages?

In theory, every moved page or folder on your website, every deleted post on your blog, or every discontinued product on your e-commerce store should be handled, with the reader, customer or search engine being redirected to the appropriate replacement page… right?

That is of course much easier said than done. When you’re e-commerce store has thousands of products, you’re blog has hundreds of posts or your website has dozens of redundant pages, its going to be incredibly hard to manage all of them.

We’ve mentioned above that in theory you should be handling all of your 404 errors. The reason for this is straightforward – it is a waste of time, bandwidth and server resources not to handle them. It is another reason for the reader to leave your site, and another reason for your customer to go to your competitor. But handling all of them can take time, so we need to apply some common sense to how we go about it. Firstly, check the following:

  1. Are the 404 errors on your website handled at all? Try entering a non existent page name and see what happens
  2. Are the 404 errors returned different? Does a non-existant folder return a different error to a non-existent page name
  3. Do some pages return different errors to others? In the case of asp.net, entering a non-existent page with an html extension (default.html) can invoke a different page to entering a non-existant page with a aspx extension (default.aspx) for example

If you aren’t happy with any of the above, you need to address these problems first.

Dealing with the 404 pages

By now you will hopefully know what happens when a 404 happens on your site. The worst case is, nothing! But more than likely, your web server, or web host will deliver a default, fairly un-useful and pretty ugly page. They normally don’t convey any information to the visitor about why they saw this page and so are often a dead end, with the end result that the customer just leaves your site.

Create your own 404 page

Firstly, create an attractive 404 page for your website. It should be the same design as the main site, complete with any navigation, and explain to the customer in nice terms that the page they were looking for could not be found. Its not good practice at this point to say that the error was the visitors fault! I’ve seen plenty of 404 pages that say “you’ve typed in an incorrect url”, or “you’ve followed an out of date link” and to be honest its pretty annoying, even if I did make a typo in the url.

When you’re happy with the page, you need set the system up so it is shown when a 404 page would be shown. This is generally quite straightforward, but you will need to investigate your particular set up yourself to find out how to do it.

ASP.NET

Setting up 404 pages on a Windows server is done through ‘Custom Errors’ tab of your website ‘Properties’ in IIS Manager. If you are running ASP.NET, any 404 erros that occur in the application are handled by ASP.NET and not IIS. For example, say you have a .net 2 application called ‘work’ in the ‘work’ folder of your web server:

http://www.mcgovern.co.uk/work

And a selection of HTML pages in the live folder of your web server:

http://www.mcgovern.co.uk/live

If you look for the non-existent page in ‘live’:

http://www.mcgovern.co.uk/live/non-existant.html

IIS will take over the request and show the 404 page specified. If however you look for:

http://www.mcgovern.co.uk/work/non-existant.aspx

…ASP.NET will assume this is an error with the application, and display a .NET error page instead. To counter this, amend the web.config file to:


<customErrors mode="Off">
<error statusCode="404" redirect="yourerror404page.aspx" />
</customErrors>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.