You are Here: FAQ ->Website Building->Website Publishing->htaccess->Article #1


WebHosting 5.0 This article is for 1&1 Linux WebHosting only.


How do I create custom Error Pages?




The error pages come in a variety of forms, but is customised by the webmaster.
For example:

Sorry We're sorry, but the requested URL does not exist. Please e-mail support@your_domain.com if you need further assistance.

Such messages are called error documents, and are web pages designed to give a polite explanation for error conditions. These error conditions generate numbers which are used to refer to the appropriate error condition. Some of the most common messages are as follows:

400 Bad syntax
403 Forbidden
404 Not Found - Most common
500 Internal Error


How do I customise error messages?

1. First, create the HTML page you want to use as your error message and upload it to your www directory.
2. Next, create a .htaccess file (using NotePad or similar) and add lines which specify the substitution. Here are three examples of specifying error documents which will be called for a given error condition (note you can use relative or absolute addressing):

ErrorDocument 400 http://www.your_domain.com/400.html
ErrorDocument 403 http://www.your_domain.com/403.html
ErrorDocument 404 http://www.your_domain.com/404.html
ErrorDocument 500 http://www.your_domain.com/500.html


Just add these lines to your .htaccess file.
3. Next upload the .htaccess file into your domain's home directory. You will not see it once uploaded since it gets hidden by the server.
4. Test is out. Go to http://www.your_domain.com/anything_you_want.html


Print Article
How useful was this article?
(From 5 = Very Useful to 1 = Not Very Useful at all):
1 2 3 4 5