开发者

How to disable the DEFLATE module for a specific directory?

开发者 https://www.devze.com 2023-01-04 23:55 出处:网络
I am trying to figure out how to disable the DEFLATE module (gzipping) for a specific directory on my server. This is what I have in /etc/httpd/conf/httpd.conf

I am trying to figure out how to disable the DEFLATE module (gzipping) for a specific directory on my server. This is what I have in /etc/httpd/conf/httpd.conf

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

I can add somethi开发者_运维技巧ng to my .htaccess file in the specific directory or even add a something to my /vhosts/domain.com/httpdocs/conf/vhosts.conf file. I can't seem to get it to work though. Any suggestions?


I removed my original code from /etc/httpd/conf/httpd.conf and added this to my vhost.conf on this domain

<Directory "/var/www/rockchurch.com/httpdocs">
AddOutputFilterByType DEFLATE html txt xml css js php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

php_admin_value open_basedir none
php_admin_value safe_mode off
Options FollowSymLinks
</Directory>

<Directory "/var/www/rockchurch.com/httpdocs/tiny">
RemoveOutputFilter DEFLATE html txt xml css js php
</Directory>

And works well. Apparently having it in /etc/httpd/conf/httpd.conf universally adds it to all domains, which is great, but can't be changed in specific directories elsewhere.


Another way to accomplish this is to put the following line in a .htaccess file in the target directory:

 SetEnv no-gzip 1

It worked for me when the GZIP was causing issues with mod_substitute.

0

精彩评论

暂无评论...
验证码 换一张
取 消