【问题标题】:500 error when trying to add expires header to .htaccess尝试将过期标头添加到 .htaccess 时出现 500 错误
【发布时间】:2009-09-17 14:17:25
【问题描述】:

我正在尝试通过编辑我的 .htaccess 文件来添加一个遥远的未来过期标头

这是在 yslow 性能规则中推荐的

但是当我这样做时,我得到一个 500 内部服务器错误

这是我正在使用的代码,有人知道发生了什么吗?

ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000

【问题讨论】:

  • 如果出现错误,您应该始终首先查看错误日志。

标签: performance apache .htaccess


【解决方案1】:

看起来我在这个 apache 版本中没有 mod_expires,这将修复它

【讨论】:

  • 不幸的是,根据我的经验,mod_expires 默认情况下并未内置到 Apache 中。这不是唯一不是的通用模块(我记得 mod_headers 也不是)。
猜你喜欢
  • 2011-01-11
  • 2014-12-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多