Name
ErrorDocument
Synopsis
ErrorDocument
code
filename|string|URL
Description
[server config, within <VirtualHost>, within <Directory>,
or .htaccess]
Allows you to customize the response sent by your server when an error is encountered. The error code is an HTTP status code as listed in Chapter 17. Possible values are:
- filename .25i
A local file to return upon encountering this error
- string .25i
A message to return upon encountering this error; the string must be surrounded by quotes
- URL .25i
A local or remote document to redirect the user to upon encountering this error
Example usage:
ErrorDocument 404 /errors/notfound.html ErrorDocument 408 "Sorry, the server timed out - try again later" ErrorDocument 402 http://www.oreilly.com/payment/
(All; <Directory> and .htaccess in Apache 1.1 or later)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access