对于一些政府类的网站,很多支持IE6~8,而不支持使用更高版本浏览器浏览。虽然有些浏览器会自动使用兼容模式,或有些人会手动调整浏览器的兼容模式,但不是每一个人、每一款浏览器都可以做到用兼容模式。所以,强制浏览器使用指定版本的兼容模式运行,变得势在必行。若要使 Microsoft IIS 能够定义自定义 HTTP 响应标头以便所有页面自动以 EmulateIE7 模式呈现,您可以使用以下 web.config 示例

 

<configuration>
  <system.webServer>
 
    <!-- 设定网站服务器以指定预设兼容性模式 Lionden -->
    <httpProtocol>
      <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=EmulateIE7" />
      </customHeaders>
    </httpProtocol>
 
  </system.webServer>
 
</configuration>

相关文章:

  • 2021-11-26
  • 2021-11-06
  • 2022-12-23
  • 2022-02-08
  • 2021-07-29
  • 2022-12-23
  • 2021-11-14
  • 2022-01-13
猜你喜欢
  • 2021-11-28
  • 2021-12-18
  • 2021-11-27
  • 2022-12-23
  • 2021-08-17
  • 2021-09-03
相关资源
相似解决方案