</directivelist>
</related>
+ <note>
+ <title>Modern alternative: Expressions</title>
+ <p>Many use cases that previously required setting and testing
+ environment variables — including conditional headers, access
+ control, and logging — 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>
<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>
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
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