Home / Web Hosting / Custom Error Documents With Apache

Custom Error Documents With Apache

404 Not Found Drawing
Question: I noticed other websites have flashy 404 Not Found pages instead of the standard boring Apache page. How do I create my own custom error documents?

Answer: Creating your own error documents is easier than you think. Just follow these simple steps.

1. Design your pages the way you normally would. Make one for each error you want to customize.

The most common are 404: File Not Found, 403: Forbidden, 500: Internal Server Error, 401: Authorization Requied, and 400: Bad Request. You can also take a look at a more extensive list of error codes.

2. Copy the error documents to a folder in a web accessible directory (i.e. public_html or something similar). For example, it could be /www/public_html/errordocs.

3. Create an .htaccess file in the main web accessible directory.

4. Enter your codes and their corresponding files in the .htaccess file:

ErrorDocument 400 /errordocs/400.htm
ErrorDocument 401 /errordocs/401.htm
ErrorDocument 403 /errordocs/403.htm
ErrorDocument 404 /errordocs/404.htm
ErrorDocument 500 /errordocs/500.htm

That is all it takes. Now any future errors will be redirected to your custom pages.

Photo: Flickr

Check Also

servers

Importance of web hosting to business

The world of business is very ruthless and unfair in some cases. It is a …

Powered by Namesco
© Copyright InternetBlog.Org.Uk 2024, All Rights Reserved