我的托管计划是cPanel和OpenLiteSpeed,而不是Apache。我在cPanel中打开了压缩所有内容设置。这似乎在一些地方使用gzip,在其他地方使用brotli。现在,我需要防止某些目录进行这种压缩。我的托管计划给出的.htaccess规则是:
RemoveOutputFilter DEFLATE html txt xml css js php然而,当我访问这个网站,然后检查Chrome > Network并点击主页,我仍然可以看到内容-编码: br,表明Brotli仍然在参与。因此,在做一些测试时,我尝试了以下几种方法,它们都失败了:
RemoveOutputFilter BROTLI_COMPRESS;DEFLATE html txt xml css js php
RemoveOutputFilter BROTLI_COMPRESS DEFLATE html txt xml css js php
# place the following as a second line under RemoveOutputFilter DEFLATE html txt xml css js php
RemoveOutputFilter BROTLI_COMPRESS html txt xml css js php
# place the following as a second line under RemoveOutputFilter DEFLATE html txt xml css js php
RemoveOutputFilter BROTLI html txt xml css js php
# place the following as a second line under RemoveOutputFilter DEFLATE html txt xml css js php
RemoveOutputFilter BR html txt xml css js php如何使用.htaccess关闭给定目录上的所有压缩?
发布于 2022-02-22 18:59:41
cPanel使用OpenLiteSpeed代替Apache。
我想你指的是LiteSpeed企业,因为OpenLiteSpeed不会和cPanel一起工作
<IfModule LiteSpeed>
SetEnv no-brotli
SetEnv no-gzip 1
</IfModule>尝试这样做,.htaccess应该同时禁用BR和GZIP
https://stackoverflow.com/questions/71226181
复制相似问题