Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE ignores X-UA-Compatible IE=edge in response header

I have a issue regarding the compatibility mode with IE10 and IE11. As mentioned in other questions here, adding this to the web.config will solve the problem with IE rendering the page in compatibility mode in intranet:

<httpProtocol>
   <customHeaders>
      <add name="X-UA-Compatible" value="IE=edge" />
   </customHeaders>
</httpProtocol>

The doctype is

<!DOCTYPE html> 

This worked for some time, but now it won't work. The response header correctly contains this information (X-UA-Compatible IE=edge), IE11 for example runs in EDGE mode, but the user agent is

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)

This incorrect user agent causes the pages to behave incorrectly. What could be the cause for the incorrect user agent? The compatibility mode for intranet sites was always enabled, even back then when it worked.

like image 435
Jan-Patrick Ahnen Avatar asked Nov 10 '22 11:11

Jan-Patrick Ahnen


1 Answers

Possible things to look at:

  1. The code you've shown is for the http header; you might be setting the X-UA-Compatible flag in the meta tags as well and overriding the http header. Check by viewing your HTML source.

  2. If you're seeing this issue on your local network, it might be because of your browser settings; there is an IE config setting that explicitly tells it to always fall into compatibility mode when browsing sites on the local network, regardless of any X-UA-Compatible headers your page may send. This setting defaults to being switched ON. Go to the browser config and switch it off. I think this is the most likely cause.

like image 194
Spudley Avatar answered Nov 14 '22 21:11

Spudley