diff options
author | Daniel Gruno <humbedooh@apache.org> | 2012-04-27 07:42:24 +0200 |
---|---|---|
committer | Daniel Gruno <humbedooh@apache.org> | 2012-04-27 07:42:24 +0200 |
commit | 77bd109be4aa9b9d05c6d2fe9c6f10081578e68f (patch) | |
tree | c9ab4f9f489060c34acbf03df620c1e4d6dee315 /docs/manual/mod/mod_setenvif.xml | |
parent | Syntax updates for mod_r*.xml (diff) | |
download | apache2-77bd109be4aa9b9d05c6d2fe9c6f10081578e68f.tar.xz apache2-77bd109be4aa9b9d05c6d2fe9c6f10081578e68f.zip |
Syntax updates for mod_s*.xml (sans mod_ssl.xml)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1331227 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/mod/mod_setenvif.xml')
-rw-r--r-- | docs/manual/mod/mod_setenvif.xml | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/docs/manual/mod/mod_setenvif.xml b/docs/manual/mod/mod_setenvif.xml index 9ff7ff404e..a41641794e 100644 --- a/docs/manual/mod/mod_setenvif.xml +++ b/docs/manual/mod/mod_setenvif.xml @@ -44,10 +44,10 @@ on characteristics of the request</description> such as this example, which sets <code>netscape</code> if the browser is mozilla but not MSIE.</p> -<example> - BrowserMatch ^Mozilla netscape<br /> - BrowserMatch MSIE !netscape<br /> -</example> +<highlight language="config"> +BrowserMatch ^Mozilla netscape +BrowserMatch MSIE !netscape +</highlight> </summary> <seealso><a href="../env.html">Environment Variables in Apache HTTP Server</a></seealso> @@ -69,17 +69,17 @@ on characteristics of the request</description> sets environment variables conditional on the <code>User-Agent</code> HTTP request header. The following two lines have the same effect:</p> -<example> - BrowserMatchNoCase Robot is_a_robot<br /> - SetEnvIfNoCase User-Agent Robot is_a_robot<br /> -</example> +<highlight language="config"> +BrowserMatchNoCase Robot is_a_robot +SetEnvIfNoCase User-Agent Robot is_a_robot +</highlight> <p>Some additional examples:</p> -<example> - BrowserMatch ^Mozilla forms jpeg=yes browser=netscape<br /> - BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript<br /> - BrowserMatch MSIE !javascript<br /> -</example> +<highlight language="config"> +BrowserMatch ^Mozilla forms jpeg=yes browser=netscape +BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript +BrowserMatch MSIE !javascript +</highlight> </usage> </directivesynopsis> @@ -101,20 +101,20 @@ respect to case</description> module="mod_setenvif">BrowserMatch</directive> directive. However, it provides for case-insensitive matching. For example:</p> -<example> - BrowserMatchNoCase mac platform=macintosh<br /> - BrowserMatchNoCase win platform=windows<br /> -</example> +<highlight language="config"> +BrowserMatchNoCase mac platform=macintosh +BrowserMatchNoCase win platform=windows +</highlight> <p>The <directive>BrowserMatch</directive> and <directive>BrowserMatchNoCase</directive> directives are special cases of the <directive module="mod_setenvif">SetEnvIf</directive> and <directive module="mod_setenvif">SetEnvIfNoCase</directive> directives. The following two lines have the same effect:</p> -<example> - BrowserMatchNoCase Robot is_a_robot<br /> - SetEnvIfNoCase User-Agent Robot is_a_robot<br /> -</example> +<highlight language="config"> +BrowserMatchNoCase Robot is_a_robot +SetEnvIfNoCase User-Agent Robot is_a_robot +</highlight> </usage> </directivesynopsis> @@ -211,18 +211,17 @@ of</p> <var>value</var> and replace them by parenthesized subexpressions of <var>regex</var>.</p> -<example> -<title>Example:</title> - SetEnvIf Request_URI "\.gif$" object_is_image=gif<br /> - SetEnvIf Request_URI "\.jpg$" object_is_image=jpg<br /> - SetEnvIf Request_URI "\.xbm$" object_is_image=xbm<br /> - :<br /> - SetEnvIf Referer www\.mydomain\.example\.com intra_site_referral<br /> - :<br /> - SetEnvIf object_is_image xbm XBIT_PROCESSING=1<br /> - :<br /> - SetEnvIf ^TS ^[a-z] HAVE_TS<br /> -</example> +<highlight language="config"> +SetEnvIf Request_URI "\.gif$" object_is_image=gif +SetEnvIf Request_URI "\.jpg$" object_is_image=jpg +SetEnvIf Request_URI "\.xbm$" object_is_image=xbm + +SetEnvIf Referer www\.mydomain\.example\.com intra_site_referral + +SetEnvIf object_is_image xbm XBIT_PROCESSING=1 + +SetEnvIf ^TS ^[a-z] HAVE_TS +</highlight> <p>The first three will set the environment variable <code>object_is_image</code> if the request was for an image @@ -261,9 +260,9 @@ for additional examples. and applied <em>env-variable</em> in the same fashion as <directive >SetEnvIf</directive>.</p> -<example> +<highlight language="config"> SetEnvIfExpr "tolower(req('X-Sendfile')) == 'd:\images\very_big.iso')" iso_delivered -</example> +</highlight> <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> @@ -271,9 +270,9 @@ for additional examples. <p>A more useful example would be to set the variable rfc1918 if the remote IP address is a private address according to RFC 1918:</p> -<example> +<highlight language="config"> SetEnvIfExpr "-R '10.0.0.0/8' || -R '172.16.0.0/12' || -R '192.168.0.0/16'" rfc1918 -</example> +</highlight> </usage> <seealso><a href="../expr.html">Expressions in Apache HTTP Server</a>, @@ -301,9 +300,9 @@ without respect to case</description> the <directive module="mod_setenvif">SetEnvIf</directive> directive, and differs only in that the regular expression matching is performed in a case-insensitive manner. For example:</p> -<example> +<highlight language="config"> SetEnvIfNoCase Host Example\.Org site=example -</example> +</highlight> <p>This will cause the <code>site</code> environment variable to be set to "<code>example</code>" if the HTTP request header |