You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2026/04/29 20:23:59 UTC

svn commit: r1933550 - httpd/httpd/branches/2.4.x/docs/manual

Author: rbowen
Date: Wed Apr 29 20:23:59 2026
New Revision: 1933550

Log:
env: Document REDIRECT_URL, REDIRECT_STATUS and REDIRECT_ variable mechanism (Bug 59944, Bug 58739)

Modified:
   httpd/httpd/branches/2.4.x/docs/manual/env.xml

Modified: httpd/httpd/branches/2.4.x/docs/manual/env.xml
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/env.xml	Wed Apr 29 20:23:57 2026	(r1933549)
+++ httpd/httpd/branches/2.4.x/docs/manual/env.xml	Wed Apr 29 20:23:59 2026	(r1933550)
@@ -500,6 +500,45 @@
 
   </section>
 
+   <section id="redirect-vars"><title>REDIRECT_ variables</title>
+
+    <p>When an internal redirect occurs — whether from an
+    <directive module="core">ErrorDocument</directive>,
+    <module>mod_rewrite</module>,
+    <directive module="mod_dir">FallbackResource</directive>, or
+    any other internal redirect mechanism — the environment
+    variables from the original request are made available to the
+    redirect target with a <code>REDIRECT_</code> prefix.</p>
+
+    <p>Two additional variables are always set:</p>
+
+    <dl>
+      <dt><code>REDIRECT_URL</code></dt>
+      <dd>The URL-path of the original request before the internal
+      redirect. This is set by the core server, not by any specific
+      module.</dd>
+
+      <dt><code>REDIRECT_STATUS</code></dt>
+      <dd>The HTTP status code that triggered the redirect. For
+      error documents this is the error status (e.g., 404). For
+      internal redirects from <module>mod_rewrite</module> or
+      <directive module="mod_dir">FallbackResource</directive>,
+      this is typically 200.</dd>
+    </dl>
+
+    <p>For example, if <code>REQUEST_URI</code> was
+    <code>/original/path</code> and an internal redirect sends the
+    request to <code>/handler.php</code>, then the redirect target
+    will see <code>REDIRECT_URL=/original/path</code> and
+    <code>REQUEST_URI=/handler.php</code>.</p>
+
+    <p>These variables are available to CGI scripts, SSI pages, and
+    in <a href="expr.html">expressions</a>. For more information
+    about REDIRECT_ variables in the context of error documents,
+    see <a href="custom-error.html">Custom Error Responses</a>.</p>
+
+   </section>
+
   <section id="examples">
     <title>Examples</title>