Mod_headers does not work

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

 LoadModule headers_module modules/mod_headers.so LoadModule rewrite_module modules/mod_rewrite.so 

Do I need to enable something else, or is the error included .htaccess?

.htaccess.

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

Thanks in advance!

+6
source share
1 answer

Try loading the header module using

 sudo a2enmod headers sudo service apache2 restart 
+8
source

Source: https://habr.com/ru/post/896100/


All Articles