首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何用.htaccess从目录中删除Brotli压缩和Gzip压缩

如何用.htaccess从目录中删除Brotli压缩和Gzip压缩
EN

Stack Overflow用户
提问于 2022-02-22 18:00:17
回答 1查看 356关注 0票数 0

我的托管计划是cPanel和OpenLiteSpeed,而不是Apache。我在cPanel中打开了压缩所有内容设置。这似乎在一些地方使用gzip,在其他地方使用brotli。现在,我需要防止某些目录进行这种压缩。我的托管计划给出的.htaccess规则是:

代码语言:javascript
复制
RemoveOutputFilter DEFLATE html txt xml css js php

然而,当我访问这个网站,然后检查Chrome > Network并点击主页,我仍然可以看到内容-编码: br,表明Brotli仍然在参与。因此,在做一些测试时,我尝试了以下几种方法,它们都失败了:

代码语言:javascript
复制
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关闭给定目录上的所有压缩?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-02-22 18:59:41

cPanel使用OpenLiteSpeed代替Apache。

我想你指的是LiteSpeed企业,因为OpenLiteSpeed不会和cPanel一起工作

代码语言:javascript
复制
<IfModule LiteSpeed>
  SetEnv no-brotli
  SetEnv no-gzip 1 
</IfModule>

尝试这样做,.htaccess应该同时禁用BR和GZIP

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71226181

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档