How can I use `SetEnvIf` to clear an Apache2 environment variable?
- by Jamie
In my apache2 configuration I've got these lines:
SetEnv log_everything
# Create the environment variables based on access requests
SetEnvIf Request_URI "^/orders/.*$" download_access !log_everything
SetEnvIf Request_URI "^/download/.*$" download_access !log_everything
SetEnvIf Request_URI "^/wg/.*$" wg_1x1_access !log_everything
# Log the accesses using the generated environment variable as conditionals.
CustomLog ${APACHE_LOG_DIR}/download.log combined env=download_access
CustomLog ${APACHE_LOG_DIR}/wg.log combined env=wg_1x1_access
RewriteEngine on
RewriteRule "^/wg/.+$" "/wg/1x1.gif"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined env=log_everything
Which currently logs all the "download" and "orders" requests to "download.log" and "wg" requests to "wg.log", but everything is also going to access.log.
How can I configure this so that "wg" and "download/orders" requests won't be duplicated in access.log?