gpt4 book ai didi

apache - 如何禁用特定目录的 DEFLATE 模块?

转载 作者:行者123 更新时间:2023-12-02 09:57:14 27 4
gpt4 key购买 nike

我正在尝试找出如何禁用服务器上特定目录的 DEFLATE 模块(gzipping)。这是我在/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

我可以向特定目录中的 .htaccess 文件添加一些内容,甚至可以向我的/vhosts/domain.com/httpdocs/conf/vhosts.conf 文件添加一些内容。但我似乎无法让它发挥作用。有什么建议吗?

最佳答案

我从/etc/httpd/conf/httpd.conf 中删除了原始代码,并将其添加到此域上的 vhost.conf

<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>

而且效果很好。显然,将其放在/etc/httpd/conf/httpd.conf 中通常会将其添加到所有域中,这很好,但不能在其他地方的特定目录中更改。

关于apache - 如何禁用特定目录的 DEFLATE 模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3122271/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com