Place your message here

Your Guide to Professional
Web Site Design and Development

Web Development
HTML Codes
HTML Tips
Javascript Snippets
216 Safe Colors
Symbols
Web Directory
Web Resources
Internet Channels

Web Development: Business, Advertising, Internet Marketing, Promotion and Web Site Design

| Web Development | HTML Codes | HTML Tips | Javascript Snippets | 216 Safe Colors | Symbols | Recommendations |

Redirecting Your Visitors to Another Web Page on Error

By William Bontrager

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 here. 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.

About the Author:

William Bontrager Programmer/Publisher, "WillMaster Possibilities" ezine mailto:possibilities@willmaster.com

Are you looking for top quality scripts? Visit Willmaster and check out his highly acclaimed Master Series scripts. Some free, some for a fee.

Back