June 1999
Intermediate to advanced
540 pages
21h 39m
English
SetEnvIf
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:
Remote_Host
The hostname of the client, if known
Remote_Addr
The IP address of the client
Remote_User
The user which is making the request, if known
Request_Method
The name of the HTTP method being used to request information
Request_URI
The latter portion of the URL, after the host information
Referer
The URI of the referring page, if known
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
(Apache 1.3 or later)
Read now
Unlock full access