SimplyWebHosting.com KnowledgeBase Glossary    Contact Us
Search  
   
Browse by Category
SimplyWebHosting.com KnowledgeBase .: Virtuozzo and OpenVz Based Accounts .: How can I specify error pages (such as 404) using .htaccess?

How can I specify error pages (such as 404) using .htaccess?

To add custom error documents you would create a file named .htaccess (starting with the period) that contains the following lines:

ErrorDocument 404 /path/to/404webpage.html
ErrorDocument 301 /path/to/301script.pl

and so on for each error code, replacing "/path/to/404webpage.html", etc., with the appropriate file name and location. If you already have a .htaccess file in that directory just add these lines to that file. Place this file in your main /web directory.

If you are using FrontPage you risk having your site not display properly if you edit your .htaccess file since FrontPage uses that file extensively. You can add those lines to the bottom of the .htaccess file and it may or may not work; use at your own risk.

For more detailed information on adding custom error documents to your site, see the Apache website at http://httpd.apache.org/docs/2.0/mod/core.html#errordocument


How helpful was this article to you?

Related Articles

article Is it possible to use a PHP webpage (rather than HTML) for error pages such as 404?
Yes, you are able to create your own PHP error...

  8-2-2005    Views: 10220   
article How do I set up custom error message pages (such as 404) on a Plesk 5 hosting account?
These instructions apply to the MDH and...

  7-5-2005    Views: 21672   
article How do I create my own custom 404 error pages on a RAQ?
First, you will need to create your custom...

(No rating)  7-21-2005    Views: 10695   

User Comments

No comments have been posted.


.: Powered by Lore 1.5.4
Copyright 2005-2014 Advantagecom Networks, Inc.
SimplyWebHosting.com - Xen Linux Virtual Private Servers (VPS) - Paypal Accepted