Name

SetEnvIf and SetEnvIfNoCase

Synopsis

SetEnvIf attribute regex envar[=value] [..] 
SetEnvIfNoCase attribute regex envar[=value] [..] 
Server config, virtual host, directory, .htaccess (from v 1.3.14)

The attribute can be one of the HTTP request header fields, such as Host, User-Agent, Referer, and/or one of the following:

Remote_Host

The client’s hostname, if available

Remote_Addr

The client’s IP address

Remote_User

The client’s authenticated username, if available

Request_Method

GET, POST, etc.

Request_URI

The part of the URL following the scheme and host

The NoCase version works the same except that regular-expression matching is evaluated without regard to letter case.

Get Apache: The Definitive Guide, 3rd 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.