As you know if you’ve spent any time at all surfing the web, sometimes you
will see the dreaded 404 error condition. This often occurs because you’ve
entered an incorrect link (perhaps added a ‘.html’ instead of ‘.htm’ at the
end of the file) or perhaps because a site has been updated recently and
some links were broken.
Virtually all web sites (especially free sites) have some generic 404 error
page displayed when this occurs. This error pages is either (a) completely
unhelpful to a visitor or more likely (b) is very useful advertising for a
web host but completely useless for helping your users navigate your site.
One excellent reason for choosing a paid host over a free host is that you
can generally modify the .htaccess file to provide a custom 404 error page.
(This is an important feature to demand from a paid host – if they don’t let
you use this feature, find another host. This is also an excellent reason to
choose a host which runs the Apache server software over other brands. For
example, Microsoft’s Internet Information Server, IIS for short, does not
allow for this capability).
So let’s say you create a 404 error page. What do you do with it? It’s
simple – you help your visitors get back to looking around your site.
Tell them what happened – An error occurred, specifically a page was
requested and not found.
Make sure they understand they are still on your site – Sometimes this is
not clear, so be sure you include your logo and other identifications. In
fact, the standard 404 error code often means you will lose that visitor
forever because he will immediately assume the site is abandoned.
Give them some reasons why the error occurred – Most people do not know what
‘404 error’ means. Be sure and give your visitors some tips as to what might
have gone wrong. Perhaps they misspelled the URL or a link was bad?
Help them get back to surfing your site – Give them plenty of ways to
navigate back into your site. Ideally, include your standard navigation menu
and perhaps even a search option.
Inject a little humor – A joke or funny picture can help lighten up the
mood. Remember, you are presenting an error – you want to get them to smile
so they perhaps continue surfing.
Be sure your page is over 1,024 bytes in size – Some browsers will not
display error pages that are smaller than this.
The most important thing to remember is that an error message is stressful
to your visitors. These immediately give the impression that your site is
poorly maintained or perhaps even has been abandoned. You only have a few
seconds after the error occurs to get people back to surfing your site, so
you had better use that time wisely.
Another useful thing that you can do is call a special CGI routine at the
time the error occurs. How do you do this? Instead of modifying the
.htaccess file to reference an HTML document, make it reference a CGI
routine directly (perhaps with the error code as a parameter). This routine
can send an email to you (and perhaps even page you) when an error occurs.
This allows you to quickly handle any errors on your web site.
Don’t get too stressed out about 404 errors. Remember that no matter how
well you keep up your site they will occur occasionally. Even if every
single link inside your site is perfect, other people will type or code the
incorrect URLs, thus causing errors. Some search engines have bugs and
reference pages incorrectly and sometimes the web server itself returns
bogus errors. The best script that I have found to perform this function is
Error Robot, available at http://www.newmediaone.com/scripts/
Personally, I prefer using a CGI routine to send an email whenever a 404
error occurs instead of asking the visitor to send an email. This removes
the burden for quality assurance from visitors and places it upon me, where
What can you do to prevent or correct 404 errors?
– Check the links within your site on a regular basis. Correct any
references that are broken.
– If an external link, say from an article, is incorrect, you can create a
redirect page to move the visitor from the incorrect reference to the
correct reference. This is generally a lot easier than attempting to get the
author to correct the reference.
– Check each and every 404 error that occurs and take steps to correct them.
The Dreaded 404 error This article tells you the meaning of the dreaded 404
Htaccess file – Custom error pages You can use htaccess to define custom
error pages to trap 404 and other error conditions.
Check your links regularly to prevent link rot Check your links regularly to
prevent link rot.