我的托管计划是使用 OpenLiteSpeed 而不是 Apache 的 cPanel。我在 cPanel 中打开了 Compress All Content 设置。这似乎在某些地方使用 gzip,在其他地方使用 brotli。现在我需要防止某些目录进行这种压缩。我的托管计划给我的 .htaccess 规则是:
RemoveOutputFilter DEFLATE html txt xml css js php
但是,当我访问该网站,然后检查 Chrome Dev Tools > Network 并单击主页时,我仍然看到 Content-Encoding: 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 关闭给定目录上的所有压缩?