The
The directives are considered in the order they appear in
the configuration files. So more complex sequences can be used,
such as this example, which sets netscape if the
browser is mozilla but not MSIE.
The User-Agent HTTP
request header field. The first argument should be a POSIX.2
extended regular expression (similar to an
egrep-style regex). The rest of the arguments give
the names of variables to set, and optionally values to which they
should be set. These take the form of
varname, or!varname, orvarname=valueIn 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
value. If a User-Agent
string matches more than one entry, they will be merged.
Entries are processed in the order in which they appear, and
later entries can override earlier ones.
For example:
Note that the regular expression string is
case-sensitive. For case-INsensitive matching,
see the
The
The
The
The
Remote_Host - the hostname (if available) of
the client making the requestRemote_Addr - the IP address of the client
making the requestRemote_User - the authenticated username (if
available)Request_Method - the name of the method
being used (GET, POST, et
cetera)Request_Protocol - the name and version of
the protocol with which the request was made (e.g.,
"HTTP/0.9", "HTTP/1.1", etc.)Request_URI - the portion of the URL
following the scheme and host portionSome of the more commonly used request header field names
include Host, User-Agent, and
Referer.
If the attribute name doesn't match any of the
special keywords, nor any of the request's header field names,
it is tested as the name of an environment variable in the list
of those associated with the request. This allows
SetEnvIf[NoCase] directives are available for
testing in this manner. 'Earlier' means that they were
defined at a broader scope (such as server-wide) or
previously in the current directive's scope.
attribute may be a regular expression when used to match a request header. If attribute is a regular expression and it doesn't match any of the request's header names, then attribute is not tested against the request's environment variable list.
The first three will set the environment variable
object_is_image if the request was for an image
file, and the fourth sets intra_site_referral if
the referring page was somewhere on the
www.mydomain.com Web site.
The last example will set environment variable
HAVE_TS if the request contains any headers that
begin with "TS" whose values begins with any character in the
set [a-z].
The
This will cause the site environment variable
to be set to "apache" if the HTTP request header
field Host: was included and contained
Apache.Org, apache.org, or any other
combination.