Internet Explorer 11 disable "display intranet sites in compatibility view" via meta tag not working

161,435

Solution 1

Make sure:

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

is the first <meta> tag on your page, otherwise IE may not respect it.

Alternatively, the problem may be that IE is using Enterprise Mode for this website:

  • Your question mentioned that the console shows: HTML1122: Internet Explorer is running in Enterprise Mode emulating IE8.
  • If so you may need to disable enterprise mode (or like this) or turn it off for that website from the Tools menu in IE.
  • However Enterprise Mode should in theory be overridden by the X-UA-Compatible tag, but IE might have a bug...

Solution 2

This problem is generally caused by the website/intranet URL being placed in one of:

  • Compatibility Mode List
  • Internet Explorer Intranet Zone
    (with Display intranet sites in Compatibility View setting enabled)
  • Enterprise Mode List

On corporate networks, these compatibility view settings are often controlled centrally via group policy. In your case, Enterprise Mode appears to be the culprit.

IE 11 Enterprise Mode

Unfortunately setting META X-UA-Compatible will not override this.

For End-Users

Sometimes the only way for end-users to override this is to press F12 and change the Document Mode under the Emulation Tab. However this setting is not permanent and may revert once Developer Tools is closed.

You can also try to exclude your site from the Intranet zone. But the list of domains which belong to the Intranet zone is usually also controlled by the group policy, so the chance of this working is slim.

To see the list of domains that belong to the Intranet zone, go to:

Tools -> Internet Options -> Security -> Sites -> Advanced

If the list contains your subdomain and is greyed out, then you will not be able to override compatibility view until your network admin allows it.

You really need to contact your network administrator to allow changing the compatibility view settings in the group policy.

For Network Admins

Loading the website with Developer Tools open (F12) will often report the reason that IE is switching to an older mode.

All 3 settings mentioned above are generally controlled via Group Policy, although can sometimes be overridden on user machines.

If Enterprise Mode is the issue (as appears to be the case for the original poster), the following two articles might be helpful:

Solution 3

For those who are building an ASP.NET MVC project, make sure that you add the:

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

tag into your Layout (template) page. I just spent two hours debugging and tweaking, only to realize that I had only added that meta tag into my child pages. As soon as I added it to my layout page, the browser loaded in EDGE mode perfectly.

Solution 4

The marked answer is the correct one. However, Pricey, you should follow up on this with your AD and desktop admin groups. They are misusing the IE11 Enterprise Mode site list. Microsoft does NOT intend it to be used for all intranet sites within an organization at all. That would be propagating the existing "render all intranet sites in compatibility mode" setting that is the bane of corporate website advancement the world over.

It's meant to implemented as a "Black list", with the handful of sites that actually require a legacy browser mode listed in the Enterprise Mode list with their rendering requirements specified. All other sites in your organization are then freed up to use Edge. The people in your organization who implemented it with all intranet sites included to start with have completely misunderstood how Enterprise Mode is meant to be implemented.

Solution 5

Add the below property into the web.config file for IIS sites. This worked for me on my intranet in IE11.

<system.webServer>
  <httpProtocol>
    <customHeaders>
      <clear />
      <add name="X-UA-Compatible" value="IE=edge" />
    </customHeaders>
  </httpProtocol>
</system.webServer> 
Share:
161,435

Related videos on Youtube

Pricey
Author by

Pricey

Updated on July 19, 2020

Comments

  • Pricey
    Pricey almost 4 years

    I have been working on an intranet website for over 6 months were I have been using the below html5 doctype and edge compatibility meta tag to force Internet Explorer to not emulate an older browser version, and this has worked ok.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>My title</title>
        <meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
    </head>
    <body>
    </body>
    </html>
    

    The reason I was doing it this way is because the place I work uses a policy setting to enable compatibility view for all intranet sites, and this approach using the EDGE setting has worked in Internet Explorer 9.

    Intranet site compatibility view setting

    Over a month ago I was upgraded to Internet Explorer 11 and the site still worked as expected.

    Today this stopped working as expected, I can't say for sure but I think that the policy that forces the compatibility view was not enabled in IE11 and now it is... and since this has been enabled the compatibility meta tag is no longer doing what is expected, and this site is being run in the Enterprise mode which emulates IE8.

    Does anyone know how to fix this and force IE11 to be used on an intranet site when the compatibility "Enterprise mode" is being enforced? and can't be disabled via the browser settings?

    EDIT

    I have just tried adding a custom header in my web.config as explained in this answer https://stackoverflow.com/a/18257208/98706

    and this did not work for me I still get the below message in the developer toolbar console of

    HTML1122: Internet Explorer is running in Enterprise Mode emulating IE8.
    

    It is as if version 8 is being treated as the edge when this intranet compatibility setting is enabled in IE11.

    This post: https://www.leapinggorilla.com/Blog/Read/1016/ie-ate-my-css---disabling-compatability-mode explains this well, I haven't yet tried setting this header via code and our users dont have access to change their browser settings.. none of the other changes have worked as yet.

    UPDATE

    Please see my comment on this post about what the difference between Enterprise mode and compatibility mode is, because it is important.

    • Pricey
      Pricey about 9 years
      Enterprise mode is different from compatibility view, please see stackoverflow.com/a/26463309/98706 for ways to disable it but in my case it is not as simple as being able to turn it off, I wanted to override it for specific intranet sites using a meta tag but this didn't work, I have not tried again since because our sites are now on a whitelist.
  • Pricey
    Pricey over 9 years
    Yes I have already done this since, unfortunately it didn't work :(
  • sparrowt
    sparrowt over 9 years
    It might be that Enterprise Mode is on for that website (based on your question)... I've updated my answer, let me know if that helps
  • Pricey
    Pricey over 9 years
    Yea that is my specific problem, in that this is a company wide global user policy setting for Enterprise mode to be enabled in IE11 for all company Intranet websites and this is restricted, so can't be disabled. I was trying to apply a workaround that has worked for older versions of IE but now no longer works in IE11, so the only way forward atm is for me to run through hoops to get a site "white list" for sites that shouldn't run in Enterprise mode.
  • sparrowt
    sparrowt over 9 years
    "Enterprise Mode" and "Compatibility View" are different, although similar. Even if "Display intranet sites in Compatibility View" is ticked, the X-UA-Compatible tag should override this. However Enterprise Mode may override that... do you see the enterprise mode icon (media.askvg.com/articles/images5/…) when on your site?
  • sparrowt
    sparrowt over 9 years
    Also what does it say if you press F12 and look on the emulation tab? It should tell you why it's using the document mode. I think you're hitting Enterprise mode, not compatibility view.
  • Pricey
    Pricey over 9 years
    I stated in my question that it is going into Enterprise mode. What I am saying is that the setting is what is forcing it into Enterprise mode, I was not aware that they were different, Enterprise mode looks like it is IE11's new way of supporting compatibility. If there is a separate meta tag to override it, then that would be good to know.
  • sparrowt
    sparrowt over 9 years
    Yes, although there is confusion with compatibility view. I believe that "Display intranet sites in Compatibility View" shouldn't affect the behaviour of Enterprise Mode. (They are definitely different, googling "difference between ... & ..." will explain.) So you may find you need to get Enterprise Mode turned off for that site (this may be enforced from GPO, in which case this may be tricky if you have no influence over it).
  • fontophilic
    fontophilic over 9 years
    see: stackoverflow.com/questions/2518256/… if you have web.config access.
  • Mike Anderson
    Mike Anderson over 9 years
    I saw that question earlier but I guess I mistook the HTTP header line for the META line and thought I had already tried it. It worked fine once I got that straightened out. Thanks for pointing me back at it.
  • Pricey
    Pricey about 9 years
    I have tried applying the same compatibility EDGE setting into the web config and it didn't work for me, the only way I found to get this working is to request our specific websites be added to a white list so they are ignored from the new IE11 Enterprise mode, which seems to be something different from the compatibility mode. This is by no means a nice solution for me due to the loops I have to jump through to get it done every time.
  • Mike Anderson
    Mike Anderson about 9 years
    Sounds like you went down the same road as I did. There are 2 things I had to do. 1 was the EDGE setting in the META tag of the page. You might be able to do this in web.config (or not; I don't know) but I did it on the site master page. The other was adding the custom HTTP header to web.config.
  • Pricey
    Pricey about 9 years
    Yes they definitely should be doing that, but I unfortunately don't have any say in the matter, but it has been raised with them.
  • RavenHursT
    RavenHursT almost 9 years
    The statement "IE may not respect it", if the meta tag isn't the first tag in the HEAD, is in contradiction to Microsoft's own documentation on how to implement this feature: modern.ie/en-us/performance/how-to-use-x-ua-compatible
  • RavenHursT
    RavenHursT almost 9 years
    "If you are using the X-UA-Compatible META tag you want to place it as close to the top of the page's HEAD as possible. Internet Explorer begins interpreting markup using the latest version. When Internet Explorer encounters the X-UA-Compatible META tag it starts over using the designated version's engine. This is a performance hit because the browser must stop and restart analyzing the content." While it's true that placing elsewhere in the HEAD can be a performance hit, it will in no way make IE "not respect" the tag.
  • Pricey
    Pricey almost 9 years
    My problem was to do with a new Enterprise mode in IE11 which forces the browser to emulate IE8. It is not the same thing as compatibility mode, which is what this meta tag is used to override. I was using this correctly.
  • Jason Marsell
    Jason Marsell almost 9 years
    My comment was meant to assist others with the same symptoms, who are building sites in ASP.NET MVC. I wasn't addressing you, specifically.
  • Greg C.
    Greg C. almost 9 years
    P.s. I know this works because it is what we are doing at my company for newer browser based products that are not written with X-UA tags to enforce the rendering the way they want it.
  • Dean P
    Dean P almost 9 years
    Those links are invalid. They're used as an example of a url with just a computer name vs one with a FQDN.
  • MattD
    MattD almost 9 years
    Given this is likely a company wide setting your answer would have to be applied to every user's machine, which is hardly ideal.
  • Kevin
    Kevin over 8 years
    Looks like the new "Enterprise Mode" causes IE11 to ignore the meta tag: technet.microsoft.com/en-us/library/dn872481.aspx Important Enterprise Mode takes precedence over document modes, so sites that are already included in the Enterprise Mode site list won’t be affected by this update and will continue to load in Enterprise Mode, as usual.
  • Sam Watkins
    Sam Watkins over 8 years
    This is so !@#$ annoying, wasting hundreds of thousands of hours of web developers around the world.
  • Simon East
    Simon East about 8 years
    I expanded your great answer with some more details that I discovered during recent research. I hope that's OK.
  • Pricey
    Pricey almost 8 years
    Please see my update on the ticket, Enterprise mode and Compatibility mode are 2 different things
  • smoore4
    smoore4 over 7 years
    IE probably does a DNS lookup and knows the IP from that. As it is MS, it could probably do AD, but DNS makes more sense.
  • thecarpy
    thecarpy over 7 years
    @SQLDBA negative, if you specify the IP, say 10.0.0.1, the host is NOT detected as "intranet" site ... nothing to do with DNS, what do you mean with AD ? Do you mean it connects to AD and looks up the host there ? Makes no sense, why would it do that ? Then again, they are Microsoft for a reason™.
  • Pricey
    Pricey about 7 years
    Enterprise mode is there due to big companies paying millions for old web based applications that were developed for older version of Internet Explorer and then these applications either dont support new browser versions OR the company doesn't want to spend lots more money upgrading (including internal changes/tech updates to support it and training staff on the new versions). I just wish this setting was a lot easier to disable for a specific website via the web.config
  • Dan Harris
    Dan Harris over 6 years
    The meta tag will work (for compatibility mode issues, not Enterprise mode issues) for non .NET / MVC sites too btw, it's not specific to ASP.NET
  • Basic
    Basic over 6 years
    Pro tip: Example.com exists for just this purpose
  • Diana
    Diana almost 4 years
    This is still a problem and this comment adds nothing to the solution.