]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add crosslinks between env.html and expr.html
authorRich Bowen <rbowen@apache.org>
Mon, 25 May 2026 16:34:57 +0000 (16:34 +0000)
committerRich Bowen <rbowen@apache.org>
Mon, 25 May 2026 16:34:57 +0000 (16:34 +0000)
env.html now references expr.html for the modern expression-based
approach to conditional headers, access control, and logging.
The CGI variables section links to the complete variable reference
on expr.html (including REQUEST_URI, REMOTE_ADDR, etc.).

expr.html now links back to env.html for how environment variables
are set (SetEnv, SetEnvIf, [E=...]) and for the special-purpose
variable list.

Addresses: https://bz.apache.org/bugzilla/show_bug.cgi?id=70066

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934599 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/env.xml
docs/manual/expr.xml

index 2e27b4ef37b8d8176928bdde2c851c32a1350899..1320dfc4ea26d724e43b9301b9537165c66d3379 100644 (file)
       </directivelist>
     </related>
 
+    <note>
+      <title>Modern alternative: Expressions</title>
+      <p>Many use cases that previously required setting and testing
+      environment variables &mdash; including conditional headers, access
+      control, and logging &mdash; can now be handled more directly using
+      <directive module="core" type="section">If</directive> expressions
+      with the <code>reqenv</code> function. See
+      <a href="expr.html">Expressions in Apache HTTP Server</a> for the
+      expression syntax and the full list of available
+      <a href="expr.html#vars">variables</a>.</p>
+    </note>
+
     <section id="cgi-scripts">
         <title>CGI Scripts</title>
 
         allows for flexible control of access to the server based on
         characteristics of the client. For example, you can use these
         directives to deny access to a particular browser (User-Agent).
+        For more complex conditions,
+        <a href="expr.html"><code>Require expr</code></a> provides
+        an alternative that can evaluate environment variables using
+        the <code>reqenv</code> function alongside other request properties.
         </p>
 
     </section>
     These have been adopted more broadly, and are a standard
     part of passing information between the browser and the
     server, and between processes on the server side. Here we
-    discuss a few of these. Refer to the CGI spec for further
-    details.</p>
+    discuss a few of these. For the complete list of request
+    variables available in <a href="expr.html">expressions</a>
+    (including <code>REQUEST_URI</code>, <code>REMOTE_ADDR</code>,
+    <code>SERVER_NAME</code>, and many others), see the
+    <a href="expr.html#vars">expression variables</a> reference.</p>
+
+    <p>Refer to the CGI spec for further details of the standard
+    CGI meta-variables.</p>
 
     <section id="query-string">
         <title>QUERY_STRING</title>
index 6563864ec61b1729a292606c2c772f73c7d77a6c..89e1a46f0b9edf63a6ae2d11fd4ee54a39c09fda 100644 (file)
@@ -71,6 +71,7 @@
 <seealso><directive module="mod_ssl">SSLRequire</directive></seealso>
 <seealso><directive module="mod_log_debug">LogMessage</directive></seealso>
 <seealso><module>mod_include</module></seealso>
+<seealso><a href="env.html">Environment Variables in Apache httpd</a></seealso>
 
   <section id="grammar">
     <title>Grammar in Backus-Naur Form notation</title>
@@ -203,6 +204,12 @@ DIGIT       ::= &lt;any US-ASCII digit "0".."9"&gt;
     directive is evaluated before authentication is done. Therefore,
     <code>%{REMOTE_USER}</code> will not be set in this case.</p>
 
+    <p>For information on setting and manipulating request environment
+    variables (using <directive module="mod_env">SetEnv</directive>,
+    <directive module="mod_setenvif">SetEnvIf</directive>,
+    <module>mod_rewrite</module>'s <code>[E=...]</code> flag, and
+    others), see <a href="env.html">Environment Variables in Apache httpd</a>.</p>
+
     <p>The following variables provide the values of the named HTTP request
     headers. The values of other headers can be obtained with the
     <code>req</code> <a href="#functions">function</a>. Using these
@@ -637,6 +644,12 @@ DIGIT       ::= &lt;any US-ASCII digit "0".."9"&gt;
     exact timing depends on the directive the expression has been used within.
     </note>
 
+    <p>The <code>reqenv</code> function can be used to test
+    <a href="env.html#special">special-purpose environment variables</a>
+    (such as <code>no-gzip</code>, <code>nokeepalive</code>, etc.) as
+    well as any variables set via <a href="env.html#setting">SetEnv,
+    SetEnvIf, or mod_rewrite</a>.</p>
+
     <p>When the functions <code>req</code> or <code>http</code> are used,
     the header name will automatically be added to the Vary header of the
     HTTP response, except where otherwise noted for the directive accepting