8

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!

Gumbo
  • 643,351
  • 109
  • 780
  • 844
The Mask
  • 17,007
  • 37
  • 111
  • 185

2 Answers2

12

Try loading the headers module with

sudo a2enmod headers 
sudo service apache2 restart
0

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.

Muhammad Atif
  • 101
  • 3
  • 9