71

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.

naXa
  • 26,677
  • 15
  • 154
  • 213
Dennis C
  • 23,310
  • 12
  • 68
  • 98
  • Despite what some of the answers say, there is an easy fix for this as pointed out by Codex73: In Tools -> Compatibility Settings, uncheck the box which says "Display intranet sites in Compatibility View". – nedned Mar 01 '11 at 08:58
  • 35
    That may work for some, but that's not the programmatic answer that Dennis was looking for – Peder Rice Mar 24 '11 at 18:54
  • 1
    How are you detecting which mode it is in? – Jonathan Sep 26 '11 at 11:37
  • 3
    Here is a very relevant new blog article from MSFT - http://blogs.msdn.com/b/cjacks/archive/2012/02/29/using-x-ua-compatible-to-create-durable-enterprise-web-applications.aspx – program247365 Apr 11 '12 at 19:21

13 Answers13

45

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."

Glorfindel
  • 19,729
  • 13
  • 67
  • 91
Dennis C
  • 23,310
  • 12
  • 68
  • 98
  • 1
    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) – Juan Mendes Jan 19 '11 at 20:34
  • `X-UA-Compatible` tag is supposed to *override* mode that browser would otherwise use, isn't it? – Tuukka Mustonen Aug 04 '11 at 11:33
  • 1
    @Tuuka: yes, but it looks like X-UA-Compatible will not override the "Display intranet sites in Compatibility View" setting. – codeulike Oct 20 '11 at 16:39
  • 12
    Or, to be more precise, X-UA-Compatible will override the document mode but not the browser mode – codeulike Oct 20 '11 at 17:48
  • 1
    I added an MSDN reference that confirms the assertion that "there is no way to bypass the IE8 setting" – cfs Jul 31 '13 at 14:48
35

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>

Andras Csehi
  • 4,309
  • 1
  • 25
  • 36
  • 22
    (to clarify: It works for the document mode, but not browser mode) – codeulike Oct 20 '11 at 17:49
  • 3
    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. – Albireo Jun 12 '12 at 09:39
  • @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: http://blogs.msdn.com/b/hanuk/archive/2008/08/28/apache-httpd-configuration-for-ie7-standard-mode-rendering-in-ie8.aspx – Kasey Speakman Jul 13 '12 at 15:44
  • 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: http://get-spblog.com/2012/05/ – alirobe Aug 27 '12 at 06:46
  • I have an intranet site written in .net which broke when going to Windows 8 and IE 10. This fixed the problem. Thanks. – Jon Jan 09 '13 at 16:45
  • This won't work as the tag takes precedence over HTTP headers. See: http://stackoverflow.com/questions/9128739/which-x-ua-compatible-takes-precedence-http-header-or-meta-tags – GlennG Mar 08 '13 at 16:47
  • sadly, my IE8 still uses Compat mode with such web.config change. – hardywang Jun 14 '13 at 18:08
  • how do i do it on wordpress 3.5.1 – shorif2000 Sep 18 '13 at 14:13
  • 1
    The question is specifically about browser mode, not document mode. `X-UA-Compatible` does nothing to the browser mode. The answer is absolutely incorrect. – Vsevolod Golovanov May 25 '15 at 13:12
11

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

Adaline Simonian
  • 4,076
  • 1
  • 22
  • 35
Codex73
  • 5,445
  • 9
  • 53
  • 75
  • Why would I have to make these adjustments. Please provide or link to an explanation of why security intranet settings have to be adjusted – Jesper Rønn-Jensen May 21 '10 at 11:47
  • 1
    here's your link to why: http://blogs.msdn.com/ie/archive/2008/08/27/introducing-compatibility-view.aspx You can also disable compatibility mode for all intranet sites if that what's needed. here's another link: http://support.microsoft.com/kb/956197 – Codex73 May 22 '10 at 13:58
  • 3
    Disabling compatibility mode for intranet sites is probably the more appropriate this solution, as this just stops intranet detection in general. – nedned Mar 01 '11 at 08:54
  • 1
    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). – jakub.g Jul 10 '12 at 13:04
  • 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 Aug 27 '12 at 06:45
6

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.

upshake
  • 909
  • 1
  • 11
  • 22
  • 1
    And you can easily disable this in Tools -> Compatibility Settings. – nedned Mar 01 '11 at 09:00
  • 6
    @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. – ANeves thinks SE is evil Sep 07 '11 at 13:34
  • 1
    @humblecoffee; alas it's not easy in a locked down corporate environment where a change such as this is forbidden. – GlennG Mar 08 '13 at 16:49
4

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" >
Craig A
  • 49
  • 1
3

Set a custom HTTP header instead of using the <meta... in the <head> section. These are supposed to be equivalent, but I have seen that an X-UA-Compatible HTTP header from the server will override IE 8's "Display intranet sites in Compatibility View" setting, where the <meta... element would not.

David Kolar
  • 3,397
  • 22
  • 32
  • 1
    unfortunately, it does not work. Checked the HTTP header has X-UA-Compatible: IE=8, but it still goes into "IE8 Compat" mode. – Dennis C May 03 '10 at 01:25
  • 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? – David Kolar May 03 '10 at 21:05
  • 1
    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. – Dennis C May 04 '10 at 02:19
  • 1
    I just found some more detail on the topic. http://blogs.msdn.com/b/ie/archive/2008/04/10/html-and-dom-standards-compliance-in-ie8-beta-1.aspx – Dennis C Jun 29 '10 at 10:09
  • Additionally, the `meta` version is not valid HTML5; even MS suggests to use HTTP headers as @David Kolar advises: http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx – ANeves thinks SE is evil Sep 07 '11 at 13:31
  • http://teelahti.fi/blog/disable-internet-explorer-compatibility-view-via-web-config This is a very helpful (and old) tip that solved my Internal server Compatibility problem. I tried all of your solutions before that. – GeorgiG Aug 18 '16 at 10:29
2

If you are using .NET, I have the answer for you:

HTML:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" >

Web.Config:

<system.webServer>
    <httpProtocol>
      <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=8" />
      </customHeaders>
    </httpProtocol>
Francisco Goldenstein
  • 11,917
  • 6
  • 48
  • 62
1

Read somewhere that the DOCTYPE declaration must be the very first line. No comments of any kind, nor empty lines.

In combination with setting the HTTP Response Headers, this worked for me. Browser Mode went from "IE9 Compatibility Mode" to just "IE9 Mode".

BrunoSalvino
  • 701
  • 1
  • 9
  • 20
0

This combo did the trick for me:

<!DOCTYPE HTML>
<HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
</HEAD>

at least IE developer tools reports IE9 Compat View, IE8 standards

just for kicks i tried EmulateIE7 and that worked as well. simplifying the extended !DOCTYPE was key.

0

You need remove port number from your domain site name site:1180/index/

If browser see port number in url - hi "think", that's is intranet.

setup your dns server for friendly urls - site.com/index and it work OK

ZOXEXIVO
  • 833
  • 9
  • 19
0

The answer marked as "correct" is technically correct but suggests that there is no solution to the real issue being faced by most people that is: "how do I properly show on IE8, with compatibility mode enabled, a web application which does not support compatibility mode?".

<!DOCTYPE HTML>
<HEAD>
    <meta http-equiv="X-UA-Compatible" content="Edge" >
</HEAD>

this worked for me on several workstations.

If the above code is implemented on application side, IE8 appears to behave as if it was not in compatibility mode, even though it will still show browser mode as compatibility mode.

Magnilex
  • 10,219
  • 8
  • 49
  • 72
Tia
  • 95
  • 2
  • 7
0

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation IntranetCompatibilityMode 1-->0

Yurok
  • 11
0

In order for the META declaration to work, the doctype has to be the simplified version:

<!DOCTYPE html>

Not the longer statement in Dennis' question.

Deborah
  • 3,307
  • 3
  • 26
  • 41
  • This HTML header should be magicheader of HTML5. Which I guess is not supported by IE8?? Can anyone confirm? – Dennis C Mar 01 '12 at 08:15
  • This doctype DOES work in ie8, even though HTML5 features will not. Here's a good link: http://ejohn.org/blog/html5-doctype/#postcomment – Deborah May 06 '13 at 17:23