我的托管計劃是使用 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 關閉給定目錄上的所有壓縮?
uj5u.com熱心網友回復:
使用 OpenLiteSpeed 而不是 Apache 的 cPanel。
我假設您的意思是 LiteSpeed Enterprise ,因為 OpenLiteSpeed 不適用于 cPanel
<IfModule LiteSpeed>
SetEnv no-brotli
SetEnv no-gzip 1
</IfModule>
試試這個.htaccess 應該禁用 BR 和 GZIP
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/431087.html
標籤:阿帕奇 .htaccess 光速 布罗特里 openlitespeed
上一篇:HarmonyOS Lottie組件,讓影片繪制更簡單
下一篇:RewriteBase去哪兒了?
