.htaccess打破我的网站

时间:2015-02-23 17:26:38

标签: apache .htaccess caching

我尝试使用Google Analytic的网站速度建议来优化我的网站,其中一条建议就是在我的.htaccess文件中利用浏览器缓存。

在对.htaccess进行一些研究之后,我发现我的网站没有。我创建了自己的.htaccess并填写了以下文字:

AllowOverride All

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

我已将其上传到我的网站,现在在我的网站上加载任何网页时,我会收到一个错误页面,其中包含以下内容:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable 
to complete your request.

Please contact the server administrator, [no address given] and inform them 
of the time the error occurred, and anything you might have done that may 
have caused the error.

More information about this error may be available in the server error log.

知道可能导致这种情况的原因是什么?我是新手,所以任何帮助都将不胜感激!

1 个答案:

答案 0 :(得分:3)

删除或注释掉这一行

AllowOverride All

由于htaccess中不允许使用此指令。它仅在Apache配置中允许,因此该行的存在导致内部500错误。

相关问题