xml version="1.0" encoding="ISO-8859-1"?>
|
Apache HTTP Server Version 2.2 ![]() Custom Error ResponsesAdditional functionality allows webmasters to configure the response of Apache to some error or problem. Customizable responses can be defined to be activated in the event of a server detected error or problem. If a script crashes and produces a "500 Server Error" response, then this response can be replaced with either some friendlier text or by a redirection to another URL (local or external). BehaviorOld BehaviorNCSA httpd 1.3 would return some boring old error/problem message which would often be meaningless to the user, and would provide no means of logging the symptoms which caused it. New BehaviorThe server can be asked to:
Redirecting to another URL can be useful, but only if some information can be passed which can then be used to explain and/or log the error/problem more clearly. To achieve this, Apache will define new CGI-like environment variables:
Note the At least ConfigurationUse of Here are some examples...
The syntax is,
where the action can be,
Custom Error Responses and RedirectsApache's behavior to redirected URLs has been modified so that additional environment variables are available to a script/server-include. Old behaviorStandard CGI vars were made available to a script which has been redirected to. No indication of where the redirection came from was provided. New behaviorA new batch of environment variables will be initialized for use by a script which has been redirected to. Each new variable will have the prefixREDIRECT_.
REDIRECT_ environment variables are created from
the CGI environment variables which existed prior to the
redirect, they are renamed with a REDIRECT_
prefix, i.e., HTTP_USER_AGENT becomes
REDIRECT_HTTP_USER_AGENT. In addition to these
new variables, Apache will define REDIRECT_URL
and REDIRECT_STATUS to help the script trace its
origin. Both the original URL and the URL being redirected to
can be logged in the access log.
If the ErrorDocument specifies a local redirect to a CGI
script, the script should include a "
If the script is dedicated to handling a particular error
condition, such as Note that the script must emit an appropriate
|