.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

2023-02-28,,

php项目 .htaccess文件配置如下:

#文件缓存时间配置
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css)$">
Header set Cache-Control "max-age=600"
</FilesMatch>

.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

信息提示  有模块丢失。

解决办法:

在Apache的配置文件 httpd.conf 中开启(去掉前面的#)  LoadModule headers_module modules/mod_headers.so  即可解决这个问题。

.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration的相关教程结束。

《.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration.doc》

下载本文的Word格式文档,以方便收藏与打印。