Web Server: ErrorDocument


ErrorDocument specifies the action the web server should take on certain HTTP errors (4xx, 5xx).

Description

The ErrorDocument values, if present, specify the action the web server should take if a given HTTP error occurs while accessing a URL on the web server. This allows custom error handling to be performed for one or more HTTP errors.

Custom error handling can be specified identically for all domains (global error handling), or may be different for each domain.

The default behavior is to use the same error handling for all domains, and to use the web server's built-in error handlers for each error.

Custom error handling is available for HTTP errors 400-415 and 500-505 (inclusive).

Kinds of Error Handling

Each error handler may be one of the following kinds:
  • Text message
  • Relative URL
  • Absolute URL

Text messages are used to display fixed messages when the error occurs. Text messages are specified by using a double-quote (") as the first character in the string of the error handler.

Relative URLs are used to redirect the browser to a URL in the same domain when the error occurs. Relative URLs do not have the 'http://' prefix, but do refer to a URL relative to the root, '/' (e.g. /domain/error.html).

Absolute URLs are used to redirect the browser to a URL in another domain when the error occurs. Absolute URLs specify the full URL (e.g. http://domain/error.html).

Note: not all kinds of error handling can be used with all error numbers (e.g. absolute URLs can not be used with 401 errors).

Adding a Global Error Handler: Text Message

Under Global Settings, select the error number to be modified, and enter the text message using a double -quote as the first character (e.g. "web server down please call us). Then click Save.

Text messages may be up to 150 characters in length.

Adding a Global Error Handler: Relative URL

Under Global Settings, select the error number to be modified, and enter the relative URL (e.g. /errors/err404.html). Then click Save.

Adding a Global Error Handler: Absolute URL

Under Global Settings, select the error number to be modified, and enter the absolute URL (e.g. http://localhost/errors/err404.html). Then click Save.

Adding a Domain-specific Error Handler

Under the domain desired, select the error number to be modified and enter either the text message, relative URL, or absolute URL the same as in the case of 'Adding a Global Error Handler' above. Then click Save.

Deleting an Error Handler

Locate the error number for the error handler under Global Settings or under the domain desired. Click the Delete button at the end of that line.

Deleting All Error Handlers

Locate the error number 'ALL' under Global Settings or under the domain desired. Click the Delete button at the end of that line.

Modifying an Error Handler

Locate the error number for the error handler under Global Settings or under the domain desired. Edit the string specifying the kind of error (any of: text, relative URL, or absolute URL). Click Save.