mod_headers not working

两盒软妹~` 提交于 2019-12-04 23:11:00

问题


I enable mod_headers and mod_rewrite in my http.config removing the # from line.

LoadModule headers_module modules/mod_headers.so

LoadModule rewrite_module modules/mod_rewrite.so

I need enable more something or the error is on .htaccess?

.htaccess.

RewriteEngine On
RewriteRule ^(.*?)\.x$ /$1.php [L]
<IfModule mod_headers.c>   
   <filesMatch "\.(x)$">
        Header set foo "baa"
  </filesMatch>  
</IfModule> 

Thanks in advance!


回答1:


Try loading the headers module with

sudo a2enmod headers 
sudo service apache2 restart


来源:https://stackoverflow.com/questions/7225711/mod-headers-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!