WillMaster Possibillites Logo EzineSeek Award
Sending 404s
Where They Wanted To Go

by
William Bontrager

Permission is granted to reprint the article below in its entirety provided no changes are made to the article text and the author's name, signature lines, and copyright line are printed with the article. However, you may change the article's title.

You know those "404 not found" messages you get when you type an incorrect URL. Do your site visitors see that ugly thing?

There's a simple two-step solution.

  1. Create a page that you want your visitors to see instead of the default error page. Upload it into a directory somewhere.

  2. Put an .htaccess file into your root directory. (Yes, the first character of the file name is a period.) Your root directory is where your index file is, the page they get when people use the URL http://www.yourdomain.com/

If the directory already has an .htaccess file, update it. Otherwise, create it.

Add this line to the file (with the correct directory path and HTML file name):

ErrorDocument 404 /path/to/wrongurl.html

"ErrorDocument" tells the server what follows is a method of handling errors. "404" tells the server what type of error the method is for. "/path/to/wrongurl.html" is the directory path and file name of the method; in this case the method is your custom "404 not found" page.

Use a word processor which saves as ASCII/plain text. And upload the file as text.

Within a few minutes of uploading .htaccess, incorrect URLs will be redirected to your new error page.

That's all you have to do.

The above works with Unix/Apache servers. If you don't know whether or not your server qualifies then just go ahead and do the steps above. If it works, your server qualifies. If it doesn't work, nothing happens; it won't hurt your server.

Want something more elegant?

Elegance is a program which scans the incorrect URL and automatically redirects your site visitors to where they really wanted to go.

Introducing ... (drum roll, please) ... Master404 !!!

The newly released Master404 is customizable to your site.

You design your own "404 not found" page, as above. The page can have links to different areas of your site, or whatever.

Periodically, you use your browser and view the incorrect URLs people are using. And you assign them to the URLs of the correct pages.

After that, whenever that incorrect URL is used, the visitor is automatically redirected to the page they really wanted to go to. If no correct page has been assigned to the incorrect URL, then the visitor is redirected to your custom "404 not found" page.

Master404 can be found at http://willmaster.com/master/404/ It comes complete with do-it-yourself manual and examples. Best of all, it's FREEEE!!!

If you need help with it let me know.

Copyright 1999 by William Bontrager

William Bontrager, Programmer and Publisher
"Screaming Hot CGI" programs
"WillMaster Possibilities" e-Newsletter
http://willmaster.com/possibilities/
subscribe-possibilities@willmaster.com