如何在apache2中禁用mod_deflate?

wak*_*dan 13 apache mod-deflate apache2

如何在Apache2中禁用mod_deflate

  • 对于特定目录中的文件

要么

  • 对于所有扩展名为.py的文件?

Gum*_*mbo 29

您可以为该目录/文件类型设置环境变量no-gzip:

# for URL paths that begin with "/foo/bar/"
SetEnvIf Request_URI ^/foo/bar/ no-gzip=1

# for files that end with ".py"
<FilesMatch \.py$>
    SetEnv no-gzip 1
</FilesMatch>
Run Code Online (Sandbox Code Playgroud)

  • 我可以在该文件夹中的.htaccess文件中执行此操作吗? (2认同)