尝试将 gzip 与 .htaccess 一起使用时出现错误 500

发布于 2024-08-19 17:04:44 字数 264 浏览 1 评论 0原文

我正在尝试在我的网站上使用 gzip。

我正在尝试压缩 php、css 和 js 文件。服务器是 apache 1.3,我在 .htaccess 文件中的代码是:

# compress all text & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml

但是当我上传此文件时,我只得到一个错误 500 页面。

任何想法。

I'm trying to use gzip on my site.

I'm trying to compress, php, css and js files. The server is apache 1.3, and the code I have in the .htaccess file is:

# compress all text & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml

But when I upload this, I just get an Error 500 page.

Any ideas.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧情勿念 2024-08-26 17:04:44

试试这个

<Files *>
    #Compress
    SetOutputFilter GZIP
</Files>

或者这个

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>

Try this

<Files *>
    #Compress
    SetOutputFilter GZIP
</Files>

Or this

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
浅浅 2024-08-26 17:04:44

AddOutputFilterByType 似乎在 Apache 1.3 上不可用(src)。我相信您需要使用 mod_gzip 代替。

“兼容性:在 Apache 2.0.33 及更高版本中可用;在 Apache 2.1 及更高版本中已弃用”

AddOutputFilterByType doesn't appear to be available on Apache 1.3 (src). I believe you'll need to use mod_gzip instead.

"Compatibility: Available in Apache 2.0.33 and later; deprecated in Apache 2.1 and later"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文