From a0f153975c3d359d57c47294a8fe4340f4cbcf35 Mon Sep 17 00:00:00 2001 From: brian Date: Sun, 22 Dec 1996 05:38:04 +0000 Subject: [PATCH] Reviewed by: Brian Behlendorf Submitted by: John Line, WWW server manager Fixed oversight in documentation of error_document. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@77306 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/custom-error.html | 159 +++++++++++++++++++------------ docs/manual/custom-error.html.en | 159 +++++++++++++++++++------------ docs/manual/mod/core.html | 14 +-- 3 files changed, 200 insertions(+), 132 deletions(-) diff --git a/docs/manual/custom-error.html b/docs/manual/custom-error.html index efc3f041e2..434d98a4b3 100644 --- a/docs/manual/custom-error.html +++ b/docs/manual/custom-error.html @@ -8,30 +8,47 @@

Custom error responses

+
Purpose -
Additional functionality. Allows web-masters 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.
-e.g. 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). + +

Additional 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. + +

e.g. 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). + +

+

Old behavior -
NCSA 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.

+ +
NCSA 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 behavior -
The server can be asked to; -
    -
  1. Display some other text, instead of the NCSA hard coded messages, or -
  2. redirect to a local URL, or -
  3. redirect to an external URL. -
-

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, e.g. -

+ +
The server can be asked to; +
    +
  1. Display some other text, instead of the NCSA hard coded messages, or +
  2. redirect to a local URL, or +
  3. redirect to an external URL. +
+ +

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, e.g. + +

REDIRECT_HTTP_ACCEPT=*/*, image/gif, image/x-xbitmap, image/jpeg
REDIRECT_HTTP_USER_AGENT=Mozilla/1.1b2 (X11; I; HP-UX A.09.05 9000/712)
REDIRECT_PATH=.:/bin:/usr/local/bin:/etc
@@ -42,65 +59,81 @@ REDIRECT_SERVER_NAME=crash.bang.edu
REDIRECT_SERVER_PORT=80
REDIRECT_SERVER_SOFTWARE=Apache/0.8.15
REDIRECT_URL=/cgi-bin/buggy.pl
-
+
-note the REDIRECT_ prefix.

+

note the REDIRECT_ prefix. -At least REDIRECT_URL and REDIRECT_QUERY_STRING will -be passed to the new URL (assuming it's a cgi-script or a cgi-include). The -other variables will exist only if they existed prior to the error/problem.

+

At least REDIRECT_URL and REDIRECT_QUERY_STRING will + be passed to the new URL (assuming it's a cgi-script or a cgi-include). The + other variables will exist only if they existed prior to the error/problem.

Configuration -
file: server configuration
-

Here are some examples... -

+ +
Use of "ErrorDocument" is enabled for .htaccess files when the + "FileInfo" override is allowed. + +

Here are some examples... + +

ErrorDocument 500 /cgi-bin/crash-recover
-ErrorDocument 500 "Sorry, our script crashed because %s. Oh dear
+ErrorDocument 500 "Sorry, our script crashed. Oh dear
ErrorDocument 500 http://xxx/
ErrorDocument 404 /Lame_excuses/not_found.html
ErrorDocument 401 /Subscription/how_to_subscribe.html -
-The syntax is,

-ErrorDocument -<3-digit-code> action

- -where the action can be, -

    -
  1. Text to be displayed.
    Prefix the text with a quote ("). Whatever -follows the quote is displayed. If the error/problem produced any additional -information, it can be specified using %s. -Note: the (") prefix isn't displayed. -
  2. An external URL to redirect to. -
  3. A local URL to redirect to. -
-

ErrorDocument definitions are sensitive to a -SIGHUP, so you can change any of the definitions or add new ones -prior to sending a SIGHUP (kill -1) signal. +

+ +

The syntax is, + +

ErrorDocument +<3-digit-code> action + +

where the action can be, + +

    +
  1. Text to be displayed. Prefix the text with a quote ("). Whatever + follows the quote is displayed. Note: the (") prefix isn't + displayed. + +
  2. An external URL to redirect to. + +
  3. A local URL to redirect to. + +
+


Custom error responses and redirects

+
+
Purpose -
Apache's behavior to redirected URLs has been modified so that additional -environment variables are available to a script/server-include.

+ +

Apache's behavior to redirected URLs has been modified so that additional + environment variables are available to a script/server-include.

Old behavior -
Standard CGI vars were made available to a script which has been -redirected to. No indication of where the redirection came from was provided. -

+ +

Standard CGI vars were made available to a script which has been + redirected to. No indication of where the redirection came from was provided. + +

+

New behavior -
A new batch of environment variables will be initialized for use by a -script which has been redirected to.
-Each new variable will have the prefix REDIRECT_.
-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 -> 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.
-Logging: both the original URL and the URL being redirected to, will -now be logged correctly in the access log.

+

+ +A new batch of environment variables will be initialized for use by a +script which has been redirected to. Each new variable will have the +prefix REDIRECT_. 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. +
diff --git a/docs/manual/custom-error.html.en b/docs/manual/custom-error.html.en index efc3f041e2..434d98a4b3 100644 --- a/docs/manual/custom-error.html.en +++ b/docs/manual/custom-error.html.en @@ -8,30 +8,47 @@

Custom error responses

+
Purpose -
Additional functionality. Allows web-masters 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.
-e.g. 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). + +

Additional 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. + +

e.g. 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). + +

+

Old behavior -
NCSA 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.

+ +
NCSA 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 behavior -
The server can be asked to; -
    -
  1. Display some other text, instead of the NCSA hard coded messages, or -
  2. redirect to a local URL, or -
  3. redirect to an external URL. -
-

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, e.g. -

+ +
The server can be asked to; +
    +
  1. Display some other text, instead of the NCSA hard coded messages, or +
  2. redirect to a local URL, or +
  3. redirect to an external URL. +
+ +

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, e.g. + +

REDIRECT_HTTP_ACCEPT=*/*, image/gif, image/x-xbitmap, image/jpeg
REDIRECT_HTTP_USER_AGENT=Mozilla/1.1b2 (X11; I; HP-UX A.09.05 9000/712)
REDIRECT_PATH=.:/bin:/usr/local/bin:/etc
@@ -42,65 +59,81 @@ REDIRECT_SERVER_NAME=crash.bang.edu
REDIRECT_SERVER_PORT=80
REDIRECT_SERVER_SOFTWARE=Apache/0.8.15
REDIRECT_URL=/cgi-bin/buggy.pl
-
+
-note the REDIRECT_ prefix.

+

note the REDIRECT_ prefix. -At least REDIRECT_URL and REDIRECT_QUERY_STRING will -be passed to the new URL (assuming it's a cgi-script or a cgi-include). The -other variables will exist only if they existed prior to the error/problem.

+

At least REDIRECT_URL and REDIRECT_QUERY_STRING will + be passed to the new URL (assuming it's a cgi-script or a cgi-include). The + other variables will exist only if they existed prior to the error/problem.

Configuration -
file: server configuration
-

Here are some examples... -

+ +
Use of "ErrorDocument" is enabled for .htaccess files when the + "FileInfo" override is allowed. + +

Here are some examples... + +

ErrorDocument 500 /cgi-bin/crash-recover
-ErrorDocument 500 "Sorry, our script crashed because %s. Oh dear
+ErrorDocument 500 "Sorry, our script crashed. Oh dear
ErrorDocument 500 http://xxx/
ErrorDocument 404 /Lame_excuses/not_found.html
ErrorDocument 401 /Subscription/how_to_subscribe.html -
-The syntax is,

-ErrorDocument -<3-digit-code> action

- -where the action can be, -

    -
  1. Text to be displayed.
    Prefix the text with a quote ("). Whatever -follows the quote is displayed. If the error/problem produced any additional -information, it can be specified using %s. -Note: the (") prefix isn't displayed. -
  2. An external URL to redirect to. -
  3. A local URL to redirect to. -
-

ErrorDocument definitions are sensitive to a -SIGHUP, so you can change any of the definitions or add new ones -prior to sending a SIGHUP (kill -1) signal. +

+ +

The syntax is, + +

ErrorDocument +<3-digit-code> action + +

where the action can be, + +

    +
  1. Text to be displayed. Prefix the text with a quote ("). Whatever + follows the quote is displayed. Note: the (") prefix isn't + displayed. + +
  2. An external URL to redirect to. + +
  3. A local URL to redirect to. + +
+


Custom error responses and redirects

+
+
Purpose -
Apache's behavior to redirected URLs has been modified so that additional -environment variables are available to a script/server-include.

+ +

Apache's behavior to redirected URLs has been modified so that additional + environment variables are available to a script/server-include.

Old behavior -
Standard CGI vars were made available to a script which has been -redirected to. No indication of where the redirection came from was provided. -

+ +

Standard CGI vars were made available to a script which has been + redirected to. No indication of where the redirection came from was provided. + +

+

New behavior -
A new batch of environment variables will be initialized for use by a -script which has been redirected to.
-Each new variable will have the prefix REDIRECT_.
-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 -> 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.
-Logging: both the original URL and the URL being redirected to, will -now be logged correctly in the access log.

+

+ +A new batch of environment variables will be initialized for use by a +script which has been redirected to. Each new variable will have the +prefix REDIRECT_. 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. +
diff --git a/docs/manual/mod/core.html b/docs/manual/mod/core.html index 8b12f980bb..09df0ef3b9 100644 --- a/docs/manual/mod/core.html +++ b/docs/manual/mod/core.html @@ -137,8 +137,8 @@ Allow use of the authorization directives AuthDBMUserFile, AuthGroupFile, AuthName, AuthType, -AuthUserFile and -require). +AuthUserFile, +require, etc.).
FileInfo
@@ -146,8 +146,9 @@ Allow use of the directives controlling document types (AddEncoding, AddLanguage, AddType, -DefaultType and -LanguagePriority). +DefaultType, +ErrorDocument, +LanguagePriority, etc.).
Indexes
@@ -161,8 +162,8 @@ Allow use of the directives controlling directory indexing FancyIndexing, HeaderName, IndexIgnore, -IndexOptions and -ReadmeName). +IndexOptions, +ReadmeName, etc.).
Limit
@@ -342,6 +343,7 @@ please avoid that. Syntax: ErrorDocument error-code document
Context server config, virtual host, directory, .htaccess
Status: core
+Override: FileInfo
Compatibility: The directory and .htaccess contexts are only available in Apache 1.1 and later.

-- 2.50.1