【发布时间】:2016-02-24 02:32:09
【问题描述】:
出于SEO 的目的,我的web.config 文件中有这部分代码。它允许我将所有 URL 重定向到我网站 URL 的 www 格式(例如,它将 abc.com 重定向到 www.abc.com)
<rule name="Redirect to www" stopProcessing="true" >
<match url="(.*)"/>
<conditions>
<add input="{HTTP_HOST}" pattern="^www\." negate="true"/>
</conditions>
<action type="Redirect" url="http://www.{HTTP_HOST}{HTTP_URL}" redirectType="Permanent" appendQueryString="false"/>
</rule>
现在我的问题是它还将我网站的 IP 重定向到 www 格式(我的意思是将 123.123.123.123 重定向到 www.123.123.123.123)
如何从该操作中排除我网站的 IP?提前谢谢。
【问题讨论】:
-
为什么不直接说 -
<action type="Redirect" url="http://www.foo.com" ....?
标签: asp.net redirect web-config seo url-redirection