我试图找出安装在localhost上的Web应用程序。我在64位Windows机器上使用wampserver 2.5。
.htaccess
文件中的此块会生成500内部服务器错误
<IfModule mod_headers.c>
FileETag MTime Size
ExpiresActive On
ExpiresDefault "access plus 30 minutes"
Header set X-UA-Compatible "IE=edge"
Header set X-Powered-By "ADRIAN COVACI - All Rights Reserved, PhP, Javascript, Ajax, JQuery"
Header set Retry-After "120"
#---expire images after 240 minutes in the client's cache------------------------------
<FilesMatch ".(jpg|jpeg|gif|png|ico|woff|ttf|eot|otf|svg)$">
ExpiresDefault "access plus 240 minutes"
Header set Cache-Control "private"
</filesMatch>
#---expire css,js,html after 30 minutes in the client's cache-------------------------
<FilesMatch ".(css|js)$">
ExpiresDefault "access plus 30 minutes"
Header set Cache-Control "private"
</filesMatch>
#---expire media files after 30 minutes in the client's cache-------------------------
<FilesMatch ".(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault "access plus 30 minutes"
Header append Cache-Control "private"
</FilesMatch>
#---Force no caching for dynamic files---------------------------------------------
<FilesMatch ".(php|cgi|htm|html)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
我不确切知道在apache中打开哪些模块才能使其正常工作。 你有什么建议吗?
经过几次测试后,我发现问题来自ExpiresActive On
和ExpiresActive On
...我不确切知道如何处理这个问题。
答案 0 :(得分:1)
我找到了解决方案。 ExpiresActive
需要在apache模块中启用mod_expires
。