尝试修复时出错

Error when trying to fix

这是关于解决一个问题:利用浏览器缓存(未指定过期)

我在.htaccess中添加了以下代码行

<FilesMatch "(?i)^.*\.(js|css)$">
    ExpiresActive On
    ExpiresDefault A2592000
</FilesMatch>

它在服务器上完美运行,但在本地主机上,它说

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script

我错过了什么吗?

这样写:

<ifmodule mod_expires.c>
<FilesMatch "(?i)^.*\.(js|css)$">
    ExpiresActive On
    ExpiresDefault A2592000
</FilesMatch>
</ifmodule>

如果它能正常工作,则意味着 mod_expires 在您的服务器上未激活