Environment
Directives
Section titled “Directives”| Directive | Syntax |
|---|---|
SetEnv | SetEnv name value |
SetEnvIf | SetEnvIf attribute regex [!]var[=val] |
SetEnvIfNoCase | SetEnvIfNoCase attribute regex [!]var[=val] |
BrowserMatch | BrowserMatch regex [!]var[=val] |
SetEnvIf Attributes
Section titled “SetEnvIf Attributes”Remote_Addr, Remote_Host, Request_URI, Request_Method, HTTP_USER_AGENT, HTTP_REFERER, HTTP_HOST, or any HTTP request header name.
Examples
Section titled “Examples”Set Environment Variables
Section titled “Set Environment Variables”SetEnv APPLICATION_ENV productionSetEnv DB_HOST localhostConditional Variables
Section titled “Conditional Variables”SetEnvIf Remote_Addr "^192\.168\." local_networkSetEnvIf Request_URI "\.pdf$" is_pdfSetEnvIfNoCase User-Agent "bot" is_botBrowserMatch "MSIE" ie_browserUse with Header Directives
Section titled “Use with Header Directives”SetEnvIf Request_URI "\.pdf$" is_downloadHeader set Content-Disposition "attachment" env=is_download