今天在.htaccess文件中加入了
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf|gz)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
但出现了错误 在error.log中记录的是:
Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration
后来发现,需要在httpd.conf中开启
LoadModule headers_module modules/mod_headers.so
之前不知道什么原因把该项也许注释掉了?
去除前面的#号,重启apache服务就好了