How to specify my own ErrorDocuments?

Article ID: 3409 
Last Review: Oct,6 2008
Author: APPLIES TO:
  • H-Sphere

Resolution

Use this utility to define what will be done if a requested page on your site is missing or fails to open for any other reason. In order to specify your own ErrorDocuments, you need to be slightly familiar with the server returned error codes:

Successful Client Requests

200   OK
201   Created
202   Accepted
203   Non-Authorative Information
204   No Content
205   Reset Content
206   Partial Content

Client Request Redirected

300   Multiple Choices
301   Moved Permanently
302   Moved Temporarily
303   See Other
304   Not Modified
305   Use Proxy

     Client Request Errors

400   Bad Request
401   Authorization Required
402   Payment Required (not used yet)
403   Forbidden
404   Not Found
405   Method Not Allowed
406   Not Acceptable (encoding)
407   Proxy Authentication Required
408   Request Timed Out
409   Conflicting Request
410   Gone
411   Content Length Required
412   Precondition Failed
413   Request Entity Too Long
414   Request URI Too Long
415   Unsupported Media Type

     Server Errors

500   Internal Server Error
501   Not Implemented
502   Bad Gateway
503   Service Unavailable
504   Gateway Timeout
505   HTTP Version Not Supported

To configure Error Pages, do the following:

  1. Select Quick Access in the Account menu.
  2. Click the Web Options icon on the page that shows.
  3. Click the Edit icon next to the domain you need.
  4. On the Web Service page, scroll down to find the Error option and click the Add icon on its right.
  5. In the form that appears, enter the error document settings:

For Unix accounts:

  • Error Document Code: choose the one you need from the drop-down box.
  • Message or URL: the path to the page with ERROR message
    IMPORTANT: if ErrorDocument 401 is chosen in Error Document Code, the path must be relative to the local user's site home root
  • Type: Specify if the text in the previous field must be treated as a URL (Redirect) or as a text message (Message).

For Windows accounts
Users will get a slightly different form to enter the path to the custom error page.
* Note that the path should be relative to the home directory, not to the virtual host directory.

If you check "FILE":
- only static error page files can be used;
- the same error page files for this domain can be shared with other account domains.
For instance, with the following file path, all account domains will share this error page: pages\404_error.html
- use the "\" character as a delimiter in the file path;
- do not start the file path with "\".

If you check "URL":
- it will allow you to use scripts (php/ASP) to dynamically generate error pages (alternatively, use static error page files for each type of error page);
- error page files for this domain can't be shared with other domains;
- "Path to Custom Error page" must be relative to the virtual host and start with "/".



Subscription for this article changesSubscription for this article changes

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields