Skip to content Skip to sidebar Skip to footer

Http-equiv="x-ua-compatible" Content="ie=edge,chrome=1" ... Putting This In .htaccess?

I downloaded html5 boilerplate and it wouldnt validate with this in the header. I was told I can add this to

Solution 1:

Try to pass it through the web.config or htacess file

Web.Config

<httpProtocol><customHeaders><clear /><addname="X-UA-Compatible"value="IE=Edge,chrome=1" /></customHeaders></httpProtocol>

your page will be valid after that. Sorry I am not a php guy.

Solution 2:

The best htaccess configuration that I found is this one below:

<IfModulemod_setenvif.c><IfModulemod_headers.c>
    BrowserMatch MSIE ie
    Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
  </IfModule></IfModule>

Because it sends the header just for IE browsers.

Solution 3:

http://www.validatethis.co.uk/tag/x-ua-compatible/

Aaron Layton has it all hear :) Just Scroll down to the "The fix" and skip all the above :)

Or you could add it to your .htaccess file like this:

<FilesMatch "\.(htm|html|php)$">
    <IfModule mod_headers.c>
        BrowserMatch MSIE ie
        Header set X-UA-Compatible "IE=Edge,chrome=1"env=ie
    </IfModule>
</FilesMatch>

Solution 4:

How do i test to make sure this is working properly

Make a request to a URI and look at the response headers. There are plenty of tools to do that, including Charles Proxy, Firebug and Chrome Developer Tools.

What does the filesmatch parameter do?

It is described in the manual

Post a Comment for "Http-equiv="x-ua-compatible" Content="ie=edge,chrome=1" ... Putting This In .htaccess?"