[英]Why is Request.ServerVariables[“HTTP_HOST”] different from Request.Url.Host?
Same server, same site - two different results. 相同的服务器,同一站点 - 两个不同的结果。
request URL: domain.com (resolving to domain.com/default.aspx) 请求URL:domain.com(解析为domain.com/default.aspx)
request header in Firebug: domain.com Firebug中的请求标头:domain.com
Request.ServerVariables["HTTP_HOST"]
= domain.com Request.ServerVariables["HTTP_HOST"]
= domain.com
Request.Url.Host
= domain.com (Ok, this is good and expected) Request.Url.Host
= domain.com(好的,这是好的和预期的)
request URL: domain.com/default.aspx 请求URL:domain.com/default.aspx
request header in Firebug: domain.com Firebug中的请求标头:domain.com
Request.ServerVariables["HTTP_HOST"]
= domain.com Request.ServerVariables["HTTP_HOST"]
= domain.com
Request.Url.Host
= app5 (name of the server) Request.Url.Host
= app5 (服务器名称)
Looking at two requests I can't see anything that would cause that. 看看两个请求,我看不到任何可能导致这种情况的请求。 Why would this be the case?
为什么会这样呢?
Server is running Windows 2003 and IIS6. 服务器正在运行Windows 2003和IIS6。
you should check whether the IIS metabase is setup to use the hostname or a different name 您应该检查IIS元数据库是否设置为使用主机名或其他名称
command -> cscript adsutil.vbs get W3SVC/SITE-ID/USEHOSTNAME
命令 - >
cscript adsutil.vbs get W3SVC/SITE-ID/USEHOSTNAME
Result -> should be 结果 - >应该是
The parameter "USEHOSTNAME" is not set at this node.
or USEHOSTNAME : (BOOLEAN) False
或
USEHOSTNAME : (BOOLEAN) False
command -> cscript adsutil.vbs get W3SVC/SITE-ID/SETHOSTNAME
命令 - >
cscript adsutil.vbs get W3SVC/SITE-ID/SETHOSTNAME
Result -> should be 结果 - >应该是
The parameter "SETHOSTNAME" is not set at this node.
or SETHOSTNAME : (STRING) ""
或
SETHOSTNAME : (STRING) ""
change SITE-ID with the numeric id of the site. 使用站点的数字ID更改SITE-ID。
If you see any other result that means somebody has modified the above two properties of the site. 如果您看到任何其他结果,则表示有人修改了网站的上述两个属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.