<manualpage metafile="expr.xml.meta">
- <title>Expressions in Apache</title>
+ <title>Expressions in Apache HTTP Server</title>
<summary>
<p>Historically, there are several syntax variants for expressions used to express
<tr><td><code>note</code></td>
<td>Lookup request environment variable</td></tr>
<tr><td><code>env</code></td>
- <td>Reqturn first match of <code>note</code>, <code>reqenv</code>,
+ <td>Return first match of <code>note</code>, <code>reqenv</code>,
<code>osenv</code></td></tr>
<tr><td><code>tolower</code></td>
<td>Convert string to lower case</td></tr>
</usage>
+<seealso><a href="../expr.html">Expressions in Apache HTTP Server</a>,
+for a complete reference and more examples.</seealso>
<seealso><a href="../sections.html">How <Directory>, <Location>,
<Files> sections work</a> for an explanation of how these
different sections are combined when a request is received.
<code>ap_register_output_filter</code>.
</p>
- <p><var>expression</var> is described in the
+ <p><var>expression</var> is an
<a href="../expr.html">ap_expr documentation</a>.</p>
</usage>
+<seealso><a href="../expr.html">Expressions in Apache HTTP Server</a>,
+for a complete reference and examples.</seealso>
+<seealso><module>mod_include</module></seealso>
</directivesynopsis>
<directivesynopsis>
<p>All slashes which are not intended to act as delimiters in your regex must
be escaped. This is regardless of their meaning to the regex engine.</p>
</note>
+
+ <note><title>Reference Documentation</title>
+ <p>See also: <a href="../expr.html">Expressions in Apache HTTP Server</a>,
+ for a complete reference and examples.</p>
+ </note>
</section>
<directivesynopsis>
</seealso>
</directivesynopsis>
+
+<directivesynopsis>
+
+<name>SetEnvIfExpr</name>
+<description>Sets environment variables based on an expression</description>
+<syntax>SetEnvIfExpr <em>expr
+ [!]env-variable</em>[=<em>value</em>]
+ [[!]<em>env-variable</em>[=<em>value</em>]] ...</syntax>
+<contextlist><context>server config</context>
+<context>virtual host</context><context>directory</context>
+<context>.htaccess</context></contextlist>
+<override>FileInfo</override>
+
+<usage>
+ <p>The <directive>SetEnvIfExpr</directive> directive defines
+ environment variables based on an <directive type="section">If</directive>
+ <code>ap_expr</code>. These expressions will be evaluated at runtime,
+ and applied <em>env-variable</em> in the same fashion as <directive
+ >SetEnvIf</directive>.</p>
+
+<example>
+ SetEnvIfExpr "tolower(%req['X-Sendfile']) = 'D:\images\very_big.iso')" iso_delivered
+</example>
+
+ <p>This would set the environment variable <code>iso_delivered</code>
+ every time our application attempts to send it via <code>X-Sendfile</code></p>
+
+ <p>For a more useful example, consider the <code>Referer</code>
+ example from above for a site with more than one domain:</p>
+
+<example>
+ SetEnvIfExpr "${HTTP_REFERER} in www.example.com,example.com,w2.example3.org" intra_site_referral
+</example>
+</usage>
+
+<seealso><a href="../expr.html">Expressions in Apache HTTP Server</a>,
+for a complete reference and more examples.</seealso>
+<seealso><directive type="section">If</directive> can be used to achive similar
+results.</seealso>
+<seealso><module>mod_filter</module></seealso>
+<seealso><module>mod_include></module></seealso>
+</directivesynopsis>
+
<directivesynopsis>
<name>SetEnvIfNoCase</name>
<description>Sets environment variables based on attributes of the request