Name

BrowserMatch

Synopsis

                     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:

var

The environment variable is defined and given the value of 1.

!var

The environment variable is deleted.

var=value

The environment variable is set to an initial value.

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

Get Webmaster in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.