Skip to content

Environment

DirectiveSyntax
SetEnvSetEnv name value
SetEnvIfSetEnvIf attribute regex [!]var[=val]
SetEnvIfNoCaseSetEnvIfNoCase attribute regex [!]var[=val]
BrowserMatchBrowserMatch regex [!]var[=val]

Remote_Addr, Remote_Host, Request_URI, Request_Method, HTTP_USER_AGENT, HTTP_REFERER, HTTP_HOST, or any HTTP request header name.

SetEnv APPLICATION_ENV production
SetEnv DB_HOST localhost
SetEnvIf Remote_Addr "^192\.168\." local_network
SetEnvIf Request_URI "\.pdf$" is_pdf
SetEnvIfNoCase User-Agent "bot" is_bot
BrowserMatch "MSIE" ie_browser
SetEnvIf Request_URI "\.pdf$" is_download
Header set Content-Disposition "attachment" env=is_download