IE11用户代理 - 指向localhost时出错了 - 向我的PC名称转右吧? [英] IE11 User-Agent - Wrong one when pointing towards localhost - Right one when going towards my PC name?
问题描述
我正在使用Internet Explorer 11.0.9600.16438
I am using internet explorer 11.0.9600.16438
我正在本地管理我的网站。当我转到 localhost / myWebSite / Default.aspx 时,我收到以下用户代理信息:
I am hosing my website locally. When I go to localhost/myWebSite/Default.aspx I get the following User-Agent information:
Mozilla /5.0(Windows NT 6.3; WOW64; Trident / 7.0; rv:11.0),如MyCompanyName
Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like MyCompanyName
当我去时myComputerName / myWebSite / Default.aspx 我收到以下用户代理信息:
When I however go to myComputerName/myWebSite/Default.aspx i get the following User-Agent information:
Mozilla / 4.0(兼容; MSIE 7.0) ; Windows NT 6.3; WOW64; Trident / 7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)
(这是正确的,因为网站将IE设置为文档模式8)
(This is the correct one because the website sets IE to go towards Document mode 8)
我使用此User-Agent信息用于确定客户计算机上是否安装了.NET等。我需要localhost一个来显示正确的用户代理信息。为什么会有所不同?据我所知,这在IE10中不是问题。
I use this User-Agent information to determine if .NET is installed etc. on a customers computer. I need the localhost one to show the correct User-Agent information. Why does it differ? This was not a problem in IE10 as far as I know.
推荐答案
看起来IE中可怕的设置显示内部网站点兼容模式。要关闭它,请查看以下链接:
Looks like the terrible setting in IE to display intranet sites in "Compatibility mode". To turn it off check out the following link:
这篇关于IE11用户代理 - 指向localhost时出错了 - 向我的PC名称转右吧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!