跳转到内容

环境变量

指令语法
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,或任何 HTTP 请求头名称。

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