How to disable Compatibility View in IE

前端 未结 8 2030
独厮守ぢ
独厮守ぢ 2020-12-04 07:24

I am wondering how do you stop people who are using IE 8 from going to Compatibility mode?



        
8条回答
  •  误落风尘
    2020-12-04 08:04

    Another way to achieve this in Apache is by putting the following lines in .htaccess in the root folder of your website (or in Apache's config files).

    BrowserMatch "MSIE" isIE
    BrowserMatch "Trident" isIE
    Header set X-UA-Compatible "IE=edge" env=isIE
    

    This requires that you have the mod_headers and mod_setenvif modules enabled.

    The extra HTTP header only gets sent to IE browsers, and none of the others.

提交回复
热议问题