IE11 User-Agent - Wrong one when pointing towards localhost - Right one when going towards my PC name?

谁说我不能喝 提交于 2019-12-13 05:24:22

问题


I am using internet explorer 11.0.9600.16438

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) like MyCompanyName

When I however go to myComputerName/myWebSite/Default.aspx i get the following User-Agent information:

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)

(This is the correct one because the website sets IE to go towards Document mode 8)

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.


回答1:


Looks like the terrible setting in IE to display intranet sites in "Compatibility mode". To turn it off check out the following link:

http://support.myeasyprojects.net/KB/a210/how-to-turn-off-the-compatibility-view-mode-in-ie-8-ie-9.aspx



来源:https://stackoverflow.com/questions/20494198/ie11-user-agent-wrong-one-when-pointing-towards-localhost-right-one-when-goi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!