From: Martin Kraemer Date: Mon, 8 Jun 1998 19:47:11 +0000 (+0000) Subject: Update the document to include information about the new ERROR_NOTES variable X-Git-Tag: 1.3.1~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06d048191415c2c72eb6ae3747e5d726db17bef1;p=apache Update the document to include information about the new ERROR_NOTES variable git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@81510 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/misc/custom_errordocs.html b/docs/manual/misc/custom_errordocs.html index 7eee41a125..fe9060cab9 100644 --- a/docs/manual/misc/custom_errordocs.html +++ b/docs/manual/misc/custom_errordocs.html @@ -25,6 +25,7 @@ customized international server error responses
  • The common header and footer files
  • Creating ErrorDocuments in different languages
  • The fallback language +
  • Customizing Proxy Error Messages
  • HTML listing of the discussed example
    @@ -130,11 +131,11 @@ of as much server support as we can get: a .htaccess file in the /errordocs directory: a minor speed optimization. -The resulting httpd.conf configuration would the look -similar to this: (Note that you can defrine your own error +The resulting httpd.conf configuration would then look +similar to this: (Note that you can define your own error messages using this method for only part of the document tree, e.g., a /~user/ subtree. In this case, the configuration could as well -be put into the .htaccess file at the root of the subtree. In this case, +be put into the .htaccess file at the root of the subtree, and the <Directory> and </Directory> directives -but not the contained directives- must be omitted.)
    @@ -177,10 +178,10 @@ the configured error documents):
      
  • No file errordocs/403 should exist. Otherwise, it would be found and served (with the DefaultType, usually text/plain), all negotiation would be bypassed. -
  • For each language for which we have a translation (note that this need not - be the same set of languages for each error code - you can get by - with a single language version until you actually have - translated versions), a document +
  • For each language for which we have an internationalized version + (note that this need not be the same set of languages for each + error code - you can get by with a single language version until + you actually have translated versions), a document errordocs/403.shtml.lang is created and filled with the error text in that language (see below). @@ -222,7 +223,7 @@ plus a symlink for the default language.

    foot.shtml.fr,
    foot.shtml.de,
    foot.shtml symlink to foot.shtml.en

    -Both files are then simply included into the error document by using the +Both files are included into the error document by using the directives <!--#include virtual="head" --> and <!--#include virtual="foot" --> respectively: the rest of the magic occurs in mod_negotiation and @@ -281,6 +282,45 @@ A simple shell script to do it (execute within the errordocs/ dir):

    +

    Customizing Proxy Error Messages

    + +

    + As of Apache-1.3, it is possible to use the ErrorDocument + mechanism for proxy error messages as well (previous versions always + returned fixed predefined error messages). +

    +

    + Most proxy errors return an error code of [500 Internal Server Error]. + To find out whether a particular error document was invoked on behalf + of a proxy error or because of some other server error, and what the reason + for the failure was, you can check the contents of the new + ERROR_NOTES CGI environment variable: + if invoked for a proxy error, this variable will contain the actual proxy + error message text in HTML form. +

    +

    + The following excerpt demonstrates how to exploit the ERROR_NOTES + variable within an error document: +

    +
    + <!--#if expr="\"$REDIRECT_ERROR_NOTES\" = \"\"" -->
    +  <p>
    +   The server encountered an unexpected condition
    +   which prevented it from fulfilling the request. 
    +  </p>
    +  <p>
    +   <A HREF="mailto:<!--#echo var="SERVER_ADMIN" -->"
    +    SUBJECT="Error message [<!--#echo var="REDIRECT_STATUS" -->] <!--#echo var="title" --> for <!--#echo var="REQUEST_URI" -->">
    +   Please forward this error screen to <!--#echo var="SERVER_NAME" -->'s
    +   WebMaster</A>; it includes useful debugging information about
    +   the Request which caused the error.
    +   <pre><!--#printenv --></pre>
    +  </p>
    + <!--#else -->
    +  <!--#echo var="REDIRECT_ERROR_NOTES" -->
    + <!--#endif -->
    +
    +

    HTML listing of the discussed example

    So, to summarize our example, here's the complete listing of the @@ -383,12 +423,9 @@ for browser types which support animated GIFs).

    More welcome!

    If you have tips to contribute, send mail to Martin.Kraemer@Mch.SNI.De - -
    - -Index -Home +HREF="mailto:martin@apache.org">martin@apache.org - + + +