Name
BrowserMatch
Synopsis
BrowserMatch
regex
var[=value] var[=value] ...
Description
[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
(Apache 1.3 or later)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access