How can I beat broken links?

How many times have you visited a site, clicked on a link or typed in a URL, only to get back a terse message like:-

"Error 404. This page does not exist on the server. Please tell the administrator of the referring page."

Great! That was really useful! What does it mean? What should I do? Shall I spend 10 minutes trying to find where the page I want has gone to... or move on to one of the other 49,999,999 sites out there. Hmm, choices, choices...

To prevent this nightmare scenario (losing visitors is a nightmare, trust me, although perhaps not on a par with the one about your third-grade teacher and a jar full of frogs!) you need to tell visitors something meaningful, and send them happily on their way. (This is also about the time when you start kicking yourself if you are on a free site hosting service, since most won't let you get at the relevant file!)

In essence, what you need to do is to set up a way to "catch" all those broken links and to redirect people to a page of your choice. This could be the front page of your site, or a simple page explaining that the page being requested is not available, but that visitors may be interested in visiting this or that.

Note: The technique I will show you works for most sites hosted on a Unix system. If you don't know what kind of system your site is hosted on, please ask your web hosting service or ISP. If you want to find out how to prevent broken links on a site hosted on Microsoft's Internet Information Server V4.0 here's a great article to help you!

If you have access to the root (top) directory of your site, take a look using FTP or another program and see if you can locate a file called ".htaccess" This file will not exist on all servers, but it is likely to be found on a majority of them.

If you can find the file, then your troubles are almost over... open up a COPY of the file (be careful, take a copy first!) and add a line to the file (or modify the existing line, if it is already there).

The line you will need to add or modify looks similar to this (change as appropriate to refer to your own site):-

ErrorDocument 404 http://www.pr2.com/oops.htm

A few words of explanation would seem to be called for. "404" is the error code a server will return if the url that was requested does not exist. The line above basically intercepts these 404 messages and tells the server what to do... In this case, display your carefully worded "oops.htm" page for the benefit and enlightenement of your mistaken visitors.

You will then need to make the "oops.htm" page itself, and save it to your site. Take a look at two "Oops" pages for different sites I run to get an idea of the kind of information you could put on the page. Since it is just an HTML page like any other, in practice you could put anything you like on the page!

The two "Oops" pages can be found at:-

http://www.pr2.com/oops.htm" and http://www.igoldrush.com/oops.htm

Incidentally, you may be interested to know that some of the Web's largest sites also suffer from link-phobia... try each link below to see what I mean:-

"Useful" redirection page "Useless" redirection page

Here's your chance to get ahead of Bill Gates -- and that kind of chance only comes around about once every 10,000 years! So make the most of it. Check your site, make sure your visitors can always find their way. Good luck at setting your visitors onto the proper path... but remember, don't be too smug about it!

Next: Why should I get on the Web?

 Lots of Free Email
Domain Name Info
Search Engines
Affiliate Programs
Enter your email address below:-

This site's design and content are copyright Edwin Hayward 1998, and will be defended by legal action if necessary. All rights reserved.