2

I added next lines in .htaccess, which I found here How to specify vary accept encoding header in htaccess

    <IfModule mod_headers.c>
       <FilesMatch "\.(js|css|xml|gz)$">
         Header append Vary Accept-Encoding
       </FilesMatch>
     </IfModule>

but it isn't works, also I checked phpinfo (Loaded Modules: mod_headers...). I use Page Speed plugin and I can't see this header in my css file. Why it isn't works?

Community
  • 1
  • 1
AlexZd
  • 1,916
  • 2
  • 13
  • 23

3 Answers3

5

Maybe you want use this:

<IfModule mod_headers.c>
   <FilesMatch "\.(js|css|xml|gz)$">
     Header append Vary: Accept-Encoding
   </FilesMatch>
</IfModule>

with semicolon

Demian
  • 51
  • 2
0

Add this one in .htaccess file ,it will work

<IfModule mod_headers.c>
    <FilesMatch ".(js|css|xml|gz|html)$">
        Header append Vary: Accept-Encoding
    </FilesMatch>
</IfModule>
Banana
  • 7,309
  • 3
  • 19
  • 41
SureshKumaran
  • 321
  • 4
  • 6
0

If the other examples doesn't work, try this:

<IfModule mod_headers.c>
    Header set Vary "Accept-Encoding"
</IfModule>
Nickname
  • 91
  • 1
  • 12