Force "Internet Explorer 8" browser mode in intranet

93,601

Solution 1

Seem that MSFT has not consider a large intranet environment that we have many different web application running inside.

There is no way to bypass the IE8 setting, according to somewhere I read on MSDN forum.

So, I will have to beg my system administrators to put some new group policies to change "Compatibility View" setting and the value and prevent user change the value, until MSFT discover this bug and fix it.

From an MSDN blog post (emphasis theirs): "Browser Mode is chosen before IE requests web content. This means that sites cannot choose a Browser Mode."

Solution 2

It is possible to override the compatibility mode in intranet. Just add the below code to the web.config. Worked for me with IE9.

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

Solution 3

You'll have to make some adjustments to IE.

Here they are.....

In Internet Options / Local Intranet / Sites

Under : Local Intranet inside Sites, uncheck "Automatically detect intranet network".

Then select only "Include all network paths (UNCs)

See attached screenshots

Screenshot

Solution 4

I found the answers here hard to follow, so here's the important information in a nutshell:

If your intranet uses default settings for IE, IE7 Standards Mode is enforced for intranet sites regardless of any website settings.

From this:

Compatibility View and the Enterprise

A large number of line-of-business websites are Internet Explorer 7 capable today. In order to preserve compatibility, Internet Explorer 8 ships with smart defaults based on zone evaluation. In the default state, all sites on the public internet display in Internet Explorer 8 Standards mode (Compatibility View off) and all intranet websites display in Internet Explorer 7 Standards mode (Compatibility View on).

Let’s look at some examples. If you navigate to sites on your local intranet like http://myPortal and http://sharepoint/sites/mySite, Internet Explorer 8 identifies itself with a User Agent string of ‘7’, Version Vector of ‘7’, and displays webpages that trigger standards mode in Internet Explorer 7 Standards mode. This combination allows webpages that worked correctly in Internet Explorer 7 to continue to do so in IE8.

Solution 5

To override the Compatibility View settings for intranet or all websites you need to make IE8 emulate itself.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
Share:
93,601
Cristopher Van Paul
Author by

Cristopher Van Paul

Updated on December 25, 2021

Comments

  • Cristopher Van Paul
    Cristopher Van Paul over 2 years

    There are "Internet Explorer 8", "Internet Explorer 8 Compatibility Mode", and IE7 mode in IE8.

    However, the default setting in IE make all intranet website use "IE8 Compatibility Mode" even I have setted doctype, the meta tag, http header as suggested to force it into IE8 mode.

    I have

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    and

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

    But it still goes into "IE8 Compatibility Mode", without any changes in IE setting.

    How to force it into pure "IE8" mode, without change any browser's setting?

    PS. I am not talking "document mode" here.

  • Cristopher Van Paul
    Cristopher Van Paul about 14 years
    unfortunately, it does not work. Checked the HTTP header has X-UA-Compatible: IE=8, but it still goes into "IE8 Compat" mode.
  • David Kolar
    David Kolar about 14 years
    I have a better understanding of your question now. The Browser Mode is only going to influence the UA string and which Document Mode you end up in when no X-UA-Compatible is specified. So while the Document Mode can be changed, the Browser Mode cannot, I think. And this is not seen as a problem since it's the Document Mode that affects the page rendering. Is there a reason you need to change the Browser Mode, perhaps for some UA string sniffing? You've got me curious. Can you tell the difference without Developer Tools open?
  • Cristopher Van Paul
    Cristopher Van Paul about 14 years
    David, some javascript behave not the same in two modes(and you can never find a full detail list), some of the IE specific feature are even disabled in real IE8 mode. That's why they are two modes, not one. When user use the same browser, I wish they see and run the same; not a same version, different browser nightmare.
  • Jesper Rønn-Jensen
    Jesper Rønn-Jensen almost 14 years
    Why would I have to make these adjustments. Please provide or link to an explanation of why security intranet settings have to be adjusted
  • Mago Maverick
    Mago Maverick almost 14 years
    here's your link to why: blogs.msdn.com/ie/archive/2008/08/27/… You can also disable compatibility mode for all intranet sites if that what's needed. here's another link: support.microsoft.com/kb/956197
  • Cristopher Van Paul
    Cristopher Van Paul almost 14 years
    I just found some more detail on the topic. blogs.msdn.com/b/ie/archive/2008/04/10/…
  • Ruan Mendes
    Ruan Mendes over 13 years
    Mmm... a -1 marked as the answer. I actually this is the correct answer, by default IE displays intranet sites as IE8 Compatibility Mode. You don't have to change all those options that Codex mentioned though. Just uncheck the 'Display intranet sites in Compatibility View' box from the Page->Compatibility View Settings Dialog. Yeah, a big pain, all the users will have to do. Dumb idea to default all websites to Compatibility and not provide a way to override it. (+1 so it's not -1 anymore)
  • nedned
    nedned about 13 years
    Disabling compatibility mode for intranet sites is probably the more appropriate this solution, as this just stops intranet detection in general.
  • nedned
    nedned about 13 years
    And you can easily disable this in Tools -> Compatibility Settings.
  • Tuukka Mustonen
    Tuukka Mustonen almost 13 years
    X-UA-Compatible tag is supposed to override mode that browser would otherwise use, isn't it?
  • ANeves
    ANeves over 12 years
    Additionally, the meta version is not valid HTML5; even MS suggests to use HTTP headers as @David Kolar advises: msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx
  • ANeves
    ANeves over 12 years
    @humble coffee, "easily" is setting a non-standard X-UA-Compatible header. Managing local machine settings on a network strikes me as an exponentially difficult task.
  • codeulike
    codeulike over 12 years
    @Tuuka: yes, but it looks like X-UA-Compatible will not override the "Display intranet sites in Compatibility View" setting.
  • codeulike
    codeulike over 12 years
    Or, to be more precise, X-UA-Compatible will override the document mode but not the browser mode
  • codeulike
    codeulike over 12 years
    (to clarify: It works for the document mode, but not browser mode)
  • codeulike
    codeulike over 12 years
    (to clarify: It works for the document mode, but not browser mode)
  • pinkgothic
    pinkgothic over 12 years
    I believe the OP was asking about server-side solutions, not client-side solutions.
  • Cristopher Van Paul
    Cristopher Van Paul about 12 years
    This HTML header should be magicheader of HTML5. Which I guess is not supported by IE8?? Can anyone confirm?
  • O'Rooney
    O'Rooney about 12 years
    We are talking about IE8 though.
  • Albireo
    Albireo almost 12 years
    This answer is for a .NET web site, since the asker didn't ask for a .NET solution it should be edited to be technology independent.
  • jakub.g
    jakub.g almost 12 years
    The fact that I have to uncheck "Include all local (intranet) sites not listed in other zones", while the "Automatically detect intranet network" is already unchecked, is awesome (or, in other words, antipattern of usability. The visual appearance suggests 2,3,4 apply only if 1 is selected).
  • Kasey Speakman
    Kasey Speakman almost 12 years
    @Albireo: The tech-independent way to fix this is to set the X-UA-Compatible header. This answer shows how for IIS. For apache, check here: blogs.msdn.com/b/hanuk/archive/2008/08/28/…
  • alirobe
    alirobe over 11 years
    Don't do this for SharePoint! It will break all sorts of core functionality. I think it might break WebDAV support and the ActiveX control for gridview, for example. It might also break Windows password authentication integration (specifically "remember my password"). You're much better off changing the compatibility view setting under the 'advanced' tab. As a more general rule, turning this off is going to break various bits of functionality that you seriously are going to want in an intranet. Basic stuff like reducing authentication prompts comes to mind. This is a "sledgehammer" solution
  • alirobe
    alirobe over 11 years
    As we're talking about intranets, may as well put in a caveat for SharePoint: It's best not to do this, as various bits of functionality will break in IE9. My blog contains more info on this: get-spblog.com/2012/05
  • Jon
    Jon over 11 years
    I have an intranet site written in .net which broke when going to Windows 8 and IE 10. This fixed the problem. Thanks.
  • GlennG
    GlennG about 11 years
    This won't work as the <meta> tag takes precedence over HTTP headers. See: stackoverflow.com/questions/9128739/…
  • GlennG
    GlennG about 11 years
    @humblecoffee; alas it's not easy in a locked down corporate environment where a change such as this is forbidden.
  • Deborah
    Deborah about 11 years
    It is true that the DOCTYPE declaration must be the first line. A javascript include can go in front of it, but not other head elements. I voted up the -1.
  • Deborah
    Deborah about 11 years
    voted up the -1 as this answer seems valuable to me and there was no explanation for it.
  • Deborah
    Deborah about 11 years
    This doctype DOES work in ie8, even though HTML5 features will not. Here's a good link: ejohn.org/blog/html5-doctype/#postcomment
  • hardywang
    hardywang almost 11 years
    sadly, my IE8 still uses Compat mode with such web.config change.
  • cfs
    cfs almost 11 years
    I added an MSDN reference that confirms the assertion that "there is no way to bypass the IE8 setting"
  • shorif2000
    shorif2000 over 10 years
    how do i do it on wordpress 3.5.1
  • Vsevolod Golovanov
    Vsevolod Golovanov almost 9 years
    The question is specifically about browser mode, not document mode. X-UA-Compatible does nothing to the browser mode. The answer is absolutely incorrect.
  • GeorgiG
    GeorgiG over 7 years
    teelahti.fi/blog/… This is a very helpful (and old) tip that solved my Internal server Compatibility problem. I tried all of your solutions before that.