How to Create a "Custom 404 Error Page" and Get Your Lost Visitors Back
By Merle
Posted Friday, July 16, 2004
One thing that's certain on the Web is nothing stays the same for very long. This is especially true when it comes to pages of your website. When you first create your site you may think you'll never need to alter the structure. But as your site grows, chances are there will come a day when you need to move or change the names of existing pages.
So what's the problem, you ask? Well, if you've been busy promoting your website (and you should be) specific pages are going to be out there in "cyberspace" listed in search engines, on other websites in the form of link swaps, in directories, articles, etc. It would be impossible to contact all of these people and give them the new url- So what's a Webmaster to do? Create a custom 404 error page.
A custom 404 error page is a special HTML page that you create on your server that auto- matically comes up if someone types in a wrong url, misspells a url, or tries to call a page from your server that no longer exists. By creating one of these pages you can capture what would be "lost traffic" and send them to the correct place or guide them to a new page.
So what does a good custom error page contain? There are important ingredients you'll want to include:
1) Contact Info: Tell them how they can reach you by email or phone.
2) Brief Explanation: Tell them why they have reached a page that no longer exists or has been moved and give them other options.
3) Include a valid link menu, site map or search function so they may still find what they are looking for, or perhaps another page.
So now that you know what to include in your error page you need to create it, and give it a name -- something like "error404.html."
Once that's done, you need to connect to your web server and look in the root directory for a file called .htaccess You may not see it using your FTP program because all files that start with a dot are hidden under UNIX and Linux systems. You can fix that by changing your file display filter to "-la" (list all).
If you still don't see it you'll need to create it. Make sure it is named with the .dot in front of the htaccess, like this: .htaccess. If the file is already there, open it up and add the complete path to your error page like this:
ErrorDocument 404 (http://YourDomain.com/404errorpage.html)
Make sure the text is all typed on 1 line and you leave a space on both sides of the 404 part and that the E and the D in ErrorDocument is in caps.
Now just FTP this revised .htaccess page and your 404errorpage.html up to your server and you're done. Test it by typing an incorrect url into your browser and make sure your new error page is working correctly.
From now on you'll never need to worry about losing another visitor due to 'rearranging the furniture," so to speak. By helping your visitors get to where they want to go, you'll be helping them and yourself to a visitor who would otherwise been lost in space- and that's a good thing!
About the Author
Merle is an internet marketer, promotion consultant and ezine publisher. Visit her sites at (http://www.mcpromotions.com/), (http://www.merlesworld.com/) and (http;//www.ezineadauction.com/).