2.3.46 ErrorDocument
ErrorDocument customizes the message to be displayed on the web browser when an error occurs.
Description
ErrorDocument is specified to customize the message to be displayed on the web browser when an error occurs.
- text
-
Specify the character string by enclosing it in "".
- local_URL
-
Enter / at the beginning to specify the content of the local site.
- full_URL
-
Enter the URL starting with http:// or https:// to specify the content of another site.
The error status number, text, local URL, full URL, and whether they can be specified for this directive, is shown below:
Error status number (meaning) |
Text |
Local URL |
Full URL |
---|---|---|---|
400 (Bad Request) |
Y |
N |
N |
401 (Authorization Required) |
Y |
Y |
N |
403 (Forbidden) |
Y |
Y |
Y |
404 (Not Found) |
Y |
Y |
Y |
405 (Method Not Allowed) |
Y |
Y |
Y |
406 (Not Acceptable) |
Y |
Y |
Y |
408 (Request Time-out) |
N |
N |
N |
410 (Gone) |
Y |
Y |
Y |
411 (Length Required) |
Y |
N |
N |
412 (Precondition Failed) |
Y |
Y |
Y |
413 (Request Entity Too Large) |
Y |
Y |
Y |
414 (Request-URI Too Large) |
Y |
N |
N |
416 (Requested Range Not Satisfiable) |
Y |
Y |
Y |
417 (Expectation Failed) |
Y |
N |
N |
500 (Internal Server Error) |
Y |
Y |
Y |
501 (Method Not Implemented) |
Y |
Y |
Y |
502 (Bad Gateway) |
Y |
Y |
N |
503 (Service Temporarily Unavailable) |
Y# |
Y# |
Y# |
506 (Variant Also Negotiates) |
Y |
Y |
Y |
- (Legend)
-
Y: Can be specified
N: Cannot be specified
- #
-
To customize the message that was returned from the flow restriction functionality, use the QOSResponse directive or the QOSRedirect directive.
Be aware of the following points when using this directive:
-
When this directive is specified multiple times, a different specification for the same error number cannot be specified.
-
The message cannot be customized for the error status that is set within the CGI program.
-
The message cannot be customized if an error exists in the specified destination in local_URL and full_URL.
-
If a content negotiation occurs in the specified destination in local_URL and an error occurs, the message might not be able to be customized.
-
For error status that is set within the dynamically connected module by using the LoadModule directive, the message might not be able to be customized depending on the method the module was implemented.
-
When a full URL is specified, a response with a new path set to the status code 302 Found and to the location header is returned. Usually, the web browser that received the status code 302 is automatically redirected to the address specified in the location header.
-
When full URL is specified, a host name that corresponds to IPv6 address or to IPv6 address can also be specified. When specifying IPv6 address, enclose IPv6 address in [ ].
Syntax
ErrorDocument error_status_number {text|local_URL|full_URL}
Locations where it can be written
httpsd.conf, <VirtualHost>, <Directory>, and .htaccess
Overwrite permission
FileInfo level
Example
ErrorDocument 500 "Server Error." ErrorDocument 404 /missing.html ErrorDocument 403 http://some.other_server.com/subscription_info.html ErrorDocument 404 http://[2001::123:4567:89ab:cdef]/missing.html