summaryrefslogtreecommitdiff
path: root/htdocs/manual/mod/mod_browser.html
blob: 8b23055ddbb264bbbccaec3c32ec0f6020d25dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
    <meta name="generator" content="HTML Tidy, see www.w3.org" />

    <title>Apache module mod_browser</title>

<style>
.obsolete
{
  margin: 0;
  padding: 8px 10px;
  padding-left: 50px;
  padding-bottom: 10px;
  line-height: 1.4em;
  background: #f99 url(../images/warning.png) no-repeat 0px 0px;
  margin-left: auto;
  margin-right: auto;
  width: 35em;
}

.currentdocs
{
    background: #f99;
}

</style>

  </head>
  <!-- Background white, links blue (unvisited), navy (visited), red (active) -->

  <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
  vlink="#000080" alink="#FF0000">

    <div align="CENTER">
      <img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]" />

      <h3>Apache HTTP Server Version 1.3</h3>
        <div class="obsolete"><p>You are looking at the documentation for the 
        1.3 version of the Apache HTTP Server, which is no longer
        maintained, and has been declared "end of life". If you are in
        fact still using the 1.3 version, <strong style="font-weight: inherit;">please consider upgrading</strong>.
        The current version of the server is <a 
        href="http://httpd.apache.org/docs/2.4/">2.4</a>.

        The functionality provided by this module is replaced by
        <a
        href="http://httpd.apache.org/docs/2.4/mod/mod_setenvif.html"
        >mod_setenvif</a> in current versions of the product.</p> 

        </div>

    </div>


    <h1 align="CENTER">Module mod_browser</h1>
    This module is contained in the <code>mod_browser.c</code>
    file, and is compiled in by default. It provides for setting
    environment variables based on the browser. This module is part
    of Apache 1.2.* only. From Apache 1.3 onwards <code><a
    href="mod_setenvif.html">mod_setenvif</a></code> provides the
    functionality of this module. 

    <h2>Summary</h2>

    <p>This module allows you to set environment variables based on
    the name of the browser accessing your document, based on the
    <code>User-Agent</code> header field. This is especially useful
    when combined with a conditional HTML language such as <a
    href="mod_include.html">XSSI</a> or PHP, and can provide for
    simple browser-based negotiation of HTML features.</p>

    <h2>Directives</h2>

    <ul>
      <li><a href="#browsermatch">BrowserMatch</a></li>

      <li><a href="#browsermatchnocase">BrowserMatchNoCase</a></li>
    </ul>
    <hr />

    <h2><a id="browsermatch"
    name="browsermatch">BrowserMatch</a></h2>
    <a href="directive-dict.html#Syntax"
    rel="Help"><strong>Syntax:</strong></a> BrowserMatch <em>regex
    attr1 attr2...</em><br />
     <a href="directive-dict.html#Context"
    rel="Help"><strong>Context:</strong></a> server config<br />
     <a href="directive-dict.html#Status"
    rel="Help"><strong>Status:</strong></a> base<br />
     <a href="directive-dict.html#Module"
    rel="Help"><strong>Module:</strong></a> mod_browser<br />
     <a href="directive-dict.html#Compatibility"
    rel="Help"><strong>Compatibility:</strong></a> Apache 1.2 and
    above 

    <p class="currentdocs"><strong>The functionality provided by this
    directive is replaced by <a
    href="http://httpd.apache.org/docs/current/mod/mod_setenvif">mod_setenvif</a> 
    in current versions of the server.</strong></p>

    <p>The BrowserMatch directive defines environment variables
    based on the User-Agent header. The first argument should be a
    POSIX.2 extended regular expression (similar to an egrep-style
    regex). The rest of the arguments give names of variables to
    set. These take the form of either "<code>varname</code>",
    "<code>!varname</code>" or "<code>varname=value</code>". In the
    first form, the value will be set to "1". The second will
    remove the given variable if already defined, and the third
    will set the variable to the value given by <code>value</code>.
    If a User-Agent string matches more than one entry, they will
    be merged. Entries are processed in the order they appear, and
    later entries can override earlier ones.</p>

    <p>For example:</p>
<pre>
    BrowserMatch ^Mozilla forms jpeg=yes browser=netscape
    BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript
    BrowserMatch MSIE !javascript
</pre>

    <h2><a id="browsermatchnocase"
    name="browsermatchnocase">BrowserMatchNoCase</a></h2>
    <a href="directive-dict.html#Syntax"
    rel="Help"><strong>Syntax:</strong></a> BrowserMatchNoCase
    <em>regex attr1 attr2...</em><br />
     <a href="directive-dict.html#Context"
    rel="Help"><strong>Context:</strong></a> server config<br />
     <a href="directive-dict.html#Status"
    rel="Help"><strong>Status:</strong></a> base<br />
     <a href="directive-dict.html#Module"
    rel="Help"><strong>Module:</strong></a> mod_browser<br />
     <a href="directive-dict.html#Compatibility"
    rel="Help"><strong>Compatibility:</strong></a> Apache 1.2 and
    above 

    <p class="currentdocs"><strong>The functionality provided by this
    directive is replaced by <a
    href="http://httpd.apache.org/docs/current/mod/mod_setenvif">mod_setenvif</a> 
    in current versions of the server.</strong></p>

    <p>The <code>BrowserMatchNoCase</code> directive is
    semantically identical to the <a
    href="#browsermatch"><code>BrowserMatch</code></a> directive.
    However, it provides for case-insensitive matching. For
    example:</p>
<pre>
    BrowserMatchNoCase mac platform=macintosh
    BrowserMatchNoCase win platform=windows
</pre>

    <p><!--#include virtual="footer.html" -->
    </p>
  </body>
</html>