我已经修改了Apache的httpd.conf中的设置,以便能够使用mod_expires但是当我加载一个页面,现在我有一个错误500(服务器遇到内部错误,无法完成您的请求。或者CGI脚本中有错误)。
在httpd.conf中我确实有:LoadModule expires_module modules / mod_expires.so without#before。
我在Windows Vista上使用XAMPP。
还有其他的东西需要激活吗?
当.htaccess为空时,Apache服务器给出的网页没有问题。 但是我添加下面的代码,我有错误500。
<IfModule mod_expires.c> # Turn on Expires and set default to 0 ExpiresActive On ExpiresDefault A0 # Set up caching on media files for 1 year (forever?) <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"> ExpiresDefault A604800 #12 hours cache Header append Cache-Control "public" </FilesMatch> </IfModule>
有任何想法吗?
2件事情:
1-无法添加ExpiresDefault A604800#12小时caching,因为#12不是评论…评论似乎是在1行。
2-我还需要加载LoadModule headers_module modules / mod_headers.so!
感谢指出我关于检查日志womble。