【发布时间】:2013-01-24 22:41:42
【问题描述】:
有人可以协助制定重定向规则吗?
我想将 URL 中任何出现的“newjersey”替换为“new-jersey”。
任何关于如何通过 web.config 执行此操作的建议都会很棒,因为我需要立即执行此操作。蒂亚!
【问题讨论】:
标签: iis url-rewriting
有人可以协助制定重定向规则吗?
我想将 URL 中任何出现的“newjersey”替换为“new-jersey”。
任何关于如何通过 web.config 执行此操作的建议都会很棒,因为我需要立即执行此操作。蒂亚!
【问题讨论】:
标签: iis url-rewriting
通过以下方式让它工作:
<rule name="Redirect {1}/newjersey" stopProcessing="true">
<match url="^([^/]+)/newjersey$" ignoreCase="false" />
<conditions trackAllCaptures="true">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="/{R:1}/new-jersey" appendQueryString="false" />
【讨论】: