mod_setenvif.xml revision fe9dca85c9e1544931fb420615372c10c0181ea7
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<!-- $LastChangedRevision$ -->
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive Copyright 2002-2005 The Apache Software Foundation or its licensors,
51853aa2ebfdf9903a094467e1d02099f143639daaron as applicable.
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive Licensed under the Apache License, Version 2.0 (the "License");
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive you may not use this file except in compliance with the License.
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive You may obtain a copy of the License at
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive Unless required by applicable law or agreed to in writing, software
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive distributed under the License is distributed on an "AS IS" BASIS,
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive See the License for the specific language governing permissions and
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive limitations under the License.
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<description>Allows the setting of environment variables based
a27e9e05958bc51ea09edb8d8d862fe8b125313bsliveon characteristics of the request</description>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive <p>The <module>mod_setenvif</module> module allows you to set
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive environment variables according to whether different aspects of
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive the request match regular expressions you specify. These
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive environment variables can be used by other parts of the server
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive to make decisions about actions to be taken.</p>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive <p>The directives are considered in the order they appear in
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive the configuration files. So more complex sequences can be used,
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive such as this example, which sets <code>netscape</code> if the
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive browser is mozilla but not MSIE.</p>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive BrowserMatch ^Mozilla netscape<br />
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive BrowserMatch MSIE !netscape<br />
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<seealso><a href="/env.html">Environment Variables in Apache</a></seealso>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<directivesynopsis>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<description>Sets environment variables conditional on HTTP User-Agent
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive</description>
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive<syntax>BrowserMatch <em>regex [!]env-variable</em>[=<em>value</em>]
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive[[!]<em>env-variable</em>[=<em>value</em>]] ...</syntax>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive<context>virtual host</context><context>directory</context>
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive <p>The <directive>BrowserMatch</directive> is a special cases of the
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive <directive module="mod_setenvif">SetEnvIf</directive> directive that
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive sets environment variables conditional on the
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive <code>User-Agent</code> HTTP request header. The following two
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive lines have the same effect:</p>
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive BrowserMatchNoCase Robot is_a_robot<br />
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive SetEnvIfNoCase User-Agent Robot is_a_robot<br />
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive BrowserMatch ^Mozilla forms jpeg=yes browser=netscape<br />
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript<br />
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive BrowserMatch MSIE !javascript<br />
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive</directivesynopsis>