On 9/12/2012 1:16 PM, Ben Johnson wrote:
> Would it be better to disable GZIP compression for all URLs within the
> /download/ (for example) directory?
> 
> Or perhaps for certain file-types? Because I tried that with the
> following, but it seems not to have any effect (I believe this example
> to be directly from the Apache documentation, with a few additional
> extensions added):
> 
> <Location />
> SetOutputFilter DEFLATE
> 
> # Don't compress images (or other files that are already compressed)
> SetEnvIfNoCase Request_URI \
> \.(?:gif|jpe?g|png|zip|7z|rar|sit?x|mp3|flac|ogg|pdf)$ no-gzip dont-vary
> 
> # Make sure proxies don't deliver the wrong content
> Header append Vary User-Agent env=!dont-vary
> </Location>
> 
> The URLs in question take the following format:
> 
> https://localhost/public/download/My%20Installer.zip
> 
> Also, I am setting the Content-Type header appropriately, e.g., to
> "application/zip", given the above URL.
> 
> So, I'm not sure why that rule don't seem to be effective.

Is there any chance that the SetEnvIfNoCase directive is not being
satisfied due to the mod_rewrite rules that I'm using?

All requests are routed through a single file, /index.php, via the
following mod_rewrite directives:

# Rewrite URIs of the form 'index.php?q=x'
# (except for real files/directories):
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

So, a request for the URL
https://localhost/public/download/My%20Installer.zip will be rewritten
to https://localhost/public/index.php?q=/download/My%20Installer.zip .

Curiously, if I examine Apache's environment variables after the rewrite
has been performed, the "REQUEST_URI" value is
"/public/download/My%20Installer.zip".

Given the above, shouldn't the SetEnvIfNoCase directive return a match?

Thanks for any help!

-Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to