0

The Importance of 404 Pages – Part 2 – Dealing with them

Following on from the previous article (The importance of 404 Pages – Part 1, this article deals with how you can be handle the 404 errors. Part 3 will focus on dealing with specific pages and what to do with them, and Part 4 will deal with how you can keep tabs on them on an ongoing basis.

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.nearlyhometime.com/work

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

http://www.nearlyhometime.com/live

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

http://www.nearlyhometime.com/live/non-existant.html

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

http://www.nearlyhometime.com/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>

In Part 3 we’ll look at pages that you would want to handle in a specific way.