19.29. mod_setenvifThe mod_setenvif module sets environment variables based on the client's browser or other information.
BrowserMatch regex var[=value] var[=value] ... [server config] Sets environment variables based on the client's browser type. If the User-Agent HTTP header matches the regular expression specified by regex, set one or more environment variables as follows:
Here is an example of how to locate various browsers. The first sets compatible if the client is connecting with Versions 2 through 4 of Netscape. The second sets microsoft if Internet Explorer is detected: BrowserMatch ^Mozilla/[2-4] compatible !microsoft BrowserMatch MSIE microsoft
BrowserMatchNoCase regex var=value var=value ... [server config] Identical to BrowserMatch, except that matching is now case-insensitive. For example, the following would still work to detect Internet Explorer: BrowserMatch msie microsoft
SetEnvIf attribute regex var[=value] var[=value] [server config] Sets environment variables based on the attributes of an HTTP request. Some of the more common attributes are:
For example, the following sets the environment variable SOMEONE_FROM_OREILLY if the remote host resolves to the domain oreilly.com: SetEnvIf Remote_Host oreilly.com SOMEONE_FROM_OREILLY
SetEnvIfNoCase attribute regex var[=value] var[=value] [server config] Identical to SetEnvIf, except that attribute matching is now case-insensitive. Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|