Web Hosting Spotlight:

Home Web Hosting Reviews News Articles Web Hosting FAQ Hosting Glossary Resources
Menu Your Inexpensive Web Hosting Source

 Web Hosting Tools:
 

"Custom 404 Page"

by Webhostingrevealed.com staff

As far back as anyone can remember about the Internet, there has always been the 404 error page. It continues to live on to this day and still brings feelings of frustration and dread to visitors and a loss of visitors to web site owners. When people come across this error page, the first impulse is to either go back or leave the site completely. Most will encounter this error page when a web page is called that doesn't exist or the link to the page is broken or bad. There is a way to work around this and it is by creating custom 404 error pages. Now this custom page won't fix any errors that might exist on a web site but it will help visitors to continue exploring your web site without stopping them dead in their tracks at a blank page that has big letters that say "error".

Getting started
To begin, it is a good idea to create the custom HTML page you want to use to replace the default 404 error page. The page should look like if it were part of your web site in terms of design and layout. If you have a template that you use to create new web pages for your site that would be even better.

You can say almost anything in this custom 404 page that you wish but it would be a good idea to avoid putting "error" in big bold letters. The whole point of creating a custom 404 page is to not scare away your visitors. So don't just copy what the default 404 page looked like. A much better alternative is to make this custom page be an opportunity to lead your visitors to another part of your site to perform some action like buying your product or clicking on an affiliate link.

As a good rule of thumb for a custom 404 page, you should create it to lead your visitors to some other part of your site that you would like them to perform an action.

Simple programming
After you have created the new 404 page, a simple file is needed to make it work. That file is the .htaccess file. The beauty of this file is that it is supported and compatible with all types of web hosting servers. In most cases, the file already exists on the web server. If not, it is a simple matter to create.

If this file exists on your web server, go ahead and download it to your local computer as we will be making modifications to it. All that is needed is a simple text editor such as Notepad that comes built in with Windows. Open the file in your text editor. If you don't have this file, then just open a new file in your text editor and save it as ".htaccess" (don't include the quotes). All that you need to type in is the following at the top of the file:

ErrorDocument 404 http://www.mydomainname.com/404error.html

This should be on one line. The .htaccess file should be saved to the root directory of your site. The 404error.html file doesn't have to be in the above mentioned directory and can actually go in any directory you specify. The important thing is to make sure that the path to the custom error page is accurate in the .htaccess file. Also the 404 file itself can be called whatever you wish but should be something close to the above example to avoid confusion.

Final step
The last thing you need to do is upload the 2 files to your web server in the appropriate locations. And that's it. No programming skills required and now if your visitors try going to a page that doesn't exist or has a broken link, your custom 404 page can bring them back to relevant parts of your site.


ABOUT THE AUTHOR:
by Webhostingrevealed.com staff
Custom 404 Page © 2006 Webhostingrevealed.com


 

Add Us to Your Favorites  |  Link to Us |  About Us  |  Contact Us
 
Web hosting reviews and resources on inexpensive web hosting