| |


Tired of those boring, black & white server-generated error pages? This tutorial will explain how you can create your own customized error pages for users to see when they encounter an access problem.
There are 3 simple steps for creating custom error pages:
1. Create the HTML page(s) you want as your error message.
2. Upload to any place in your web directory (mainwebsite_html)
3. Create a text file named .htaccess with the appropriate filename substitutions
NOTE: you can place error pages in any directory and use relative or absolute addressing.
Example .htaccess file --------
ErrorDocument 401 /nopasswd.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /404.html
--------
If you now try going to a fake page on your site, you should be taken to the 404.html page. The reason this happens is, the server realized the page was not there, so it looks in the .htaccess file for help. Since it was a 404 error (file not found), it directed you to the appropriate page that you set in the .htaccess file.
Below is a list of errors which you can use in your .htaccess file:
Error in Client
400 Bad syntax
401 Unauthorized
402 Not Used (Payment Granted)
403 Forbidden
404 Not Found
Error in Server
500 Internal Error
501 Not Implemented
502 Overloaded
503 Gateway Timeout
Please remember to keep the syntax the same as listed in the example above:
ErrorDocument [error#] [path to .html file]
If you'd like custom error pages only for certain sub folders, you can create and upload a .htaccess file in the folder of your choice. When an error is encountered in the specific sub directory, the server will check the sub folder's .htaccess file before it checks the one in the main web folder.


|
|