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/05/22 01:50:08 UTC

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

Author: rbowen
Date: Fri May 22 01:50:07 2026
New Revision: 1934489

Log:
Clarifies what CGIVar does.

Modified:
   httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml	Fri May 22 01:49:54 2026	(r1934488)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml	Fri May 22 01:50:07 2026	(r1934489)
@@ -654,26 +654,43 @@ variables</description>
 <compatibility>Available in Apache HTTP Server 2.4.21 and later</compatibility>
 
 <usage>
-  <p>This directive controls how some CGI variables are set.</p>
+  <p>This directive controls how certain CGI environment variables are
+  set when requests are passed to CGI scripts or other handlers that
+  receive a CGI environment. Currently, the only variable supported is
+  <code>REQUEST_URI</code>.</p>
 
-  <p><strong>REQUEST_URI</strong> rules:</p>
+  <p>By default, the CGI environment variable <code>REQUEST_URI</code>
+  is set to the original URI from the client's request line. This means
+  that even if <module>mod_rewrite</module> or an internal redirect
+  changes which resource is actually being served, the CGI script still
+  sees the original URI that the client sent.</p>
+
+  <p>With <code>CGIVar REQUEST_URI current-uri</code>, the value is
+  instead set to the current URI after any rewrites or internal
+  redirects have been applied.</p>
+
+  <p><strong>Allowed values:</strong></p>
   <dl>
     <dt><code>original-uri</code> (default)</dt>
-    <dd>The value is taken from the original request line, and will not
-    reflect internal redirects or subrequests which change the requested
-    resource.</dd>
+    <dd>Set <code>REQUEST_URI</code> to the URI from the original client
+    request, regardless of any internal redirects or rewrites.</dd>
     <dt><code>current-uri</code></dt>
-    <dd>The value reflects the resource currently being processed,
-    which may be different than the original request from the client
-    due to internal redirects or subrequests.</dd>
+    <dd>Set <code>REQUEST_URI</code> to the URI of the resource
+    currently being processed, which may differ from the original
+    request due to internal redirects or rewrites.</dd>
   </dl>
 
+  <highlight language="config">
+# Show CGI scripts the rewritten URI rather than the original
+CGIVar REQUEST_URI current-uri
+  </highlight>
+
   <note><title>Note</title>
-  <p>The CGI environment variable <code>REQUEST_URI</code> contains the
-      full original URI from the request line, including the query string.
-      This differs from the server variable <code>%{REQUEST_URI}</code>
-      used in <module>mod_rewrite</module> and <a href="../expr.html">
-      ap_expr</a>, which contains only the path component.</p></note>
+  <p>The CGI environment variable <code>REQUEST_URI</code> (in either
+  mode) contains the full URI including the query string. This differs
+  from the server variable <code>%{REQUEST_URI}</code> used in
+  <module>mod_rewrite</module> and <a href="../expr.html">ap_expr</a>,
+  which contains only the path component (no query string).</p></note>
 </usage>
 </directivesynopsis>