2015-02-23 126 views
1

我想使用谷歌分析的网站速度建议来优化我的网站,它给我的建议之一是在我的.htaccess文件中利用浏览器缓存。.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. 

任何想法可能会导致这种情况?我是新来的,所以任何帮助将不胜感激!

回答

3

删除或注释掉此行

AllowOverride All 

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

+1

谢谢你解决了这个问题! – 2015-02-23 18:05:35

+0

不客气,很高兴它解决了。 – anubhava 2015-02-23 18:14:24