summaryrefslogtreecommitdiff
path: root/docs/manual/mod/mod_setenvif.xml
diff options
context:
space:
mode:
authorIgor Galić <igalic@apache.org>2010-11-20 21:47:53 +0000
committerIgor Galić <igalic@apache.org>2010-11-20 21:47:53 +0000
commit2faa163a27b299a52333249e49983b6385ff4faf (patch)
tree927c5f445150f7f7b77d8ce2ecdc9df1899983f1 /docs/manual/mod/mod_setenvif.xml
parente4f319fdc85b5d8b2b3e1ddaa05b03ead0af88a9 (diff)
downloadhttpd-2faa163a27b299a52333249e49983b6385ff4faf.tar.gz
Adding SetEnvIfExpr documentation, and more references to expr.html
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037339 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/mod/mod_setenvif.xml')
-rw-r--r--docs/manual/mod/mod_setenvif.xml43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/manual/mod/mod_setenvif.xml b/docs/manual/mod/mod_setenvif.xml
index 6c0c92a9d9..ef639a0a2c 100644
--- a/docs/manual/mod/mod_setenvif.xml
+++ b/docs/manual/mod/mod_setenvif.xml
@@ -254,6 +254,49 @@ for additional examples.
</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