X-UA HTTP Header Compatibility

Actually, I have a problem with a website in IE that is not on the intranet, and "always show pages in compatibility mode is not activated", but it still sometimes opens in quirks mode, despite adding

<meta http-equiv="X-UA-Compatible" content="IE=edge"/> 

I have red that I can send this compatibility order in the HTTP header or in htaccess

My problem is that I was looking for how to send an HTTP header and didn't actually find the hint, and btw I am a php developer just in case this information was needed.

I would really appreciate if someone could provide me with what needs to be added (for both, or for one, at least), and how / where to add it, I searched for a whole week, and it was very urgent for you find a fix so soon!

This way to send it as an HTTP header, since the first line on the page is correct?

 <?php header('X-UA-Compatible: IE=edge'); ?> 

(I just found)

I am very grateful for any help that can be provided, and I am grateful in advance.

+4
source share
1 answer

As you correctly noted, the header can be set in php:

 <?php header('X-UA-Compatible: IE=edge,chrome=1'); 

It can also be installed in .htaccess as follows:

 <IfModule mod_headers.c> Header set X-UA-Compatible "IE=Edge,chrome=1" # mod_headers can't match by content-type, but we don't want to send this header on *everything*... <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webm|webp|woff|xml|xpi)$"> Header unset X-UA-Compatible </FilesMatch> </IfModule> 

(copied from HTML5 Boilerplate )

However , if you set these headers and find that IE defaults to quirks mode by default, I would be inclined to assume that there is something else at work. Have you ensured that your pages have a valid doctype ? Notably, not for HTML 4.01.

+15
source

All Articles