Reputation: 17427
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!
Upvotes: 8
Views: 27591
Reputation: 103
I resolved this problem by clearing cache of browser. If you are looking at browser inspector of chrome then check the 'Disable Cache' in 'Network' tab. But first make sure that mod_headers is already installed and working.
Upvotes: 0
Reputation: 520
Try loading the headers module with
sudo a2enmod headers
sudo service apache2 restart
Upvotes: 12