【发布时间】:2018-12-08 00:09:33
【问题描述】:
我在这里试过web.config redirect non-www to www
并尝试过:
<rule name="ensurewww" enabled="false" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{CACHE_URL}" pattern="^(.+)://(?!www)(.*)" />
</conditions>
<action type="Redirect" url="{C:1}://www.{C:2}/{R:1}" redirectType="Permanent" />
</rule>
结果:1.abc.com ---> www.abc.com 真
结果2.abc.com/a.aspx--->www.abc.com/a.aspx 错误
结果 3.abc/com/abc---->www.abc.com/abc 假
最后:我想结果 2 和结果 3 为真
【问题讨论】:
标签: c# web iis web-config url-redirection