我想重定向旧网址 " http://staging.TempSite.com/about-us/Institute-+target/%20"
到新网址"" http://staging.TempSite.com/about-us/news-events""
<rule name="rule59" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_HOST}{REQUEST_URI}" pattern="staging.TempSite.com/about-us/Institute-\+target/\s*" />
</conditions>
<action type="Redirect" url="./about-us/news-events" />
我也尝试过跟随模式。
pattern="staging.TempSite.com/about-us/Institute-\+target/\s*$"
pattern="staging.TempSite.com/about-us/Institute-\+target/ $"
答案 0 :(得分:0)
+
,则需要在配置中启用allowDoubleEscaping
。配置示例:
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true"/>
</security>
<rewrite>
<rules>
<rule name="rule59" stopProcessing="true">
<match url="^about-us/Institute\-\+target/\s*$" />
<action type="Redirect" url="/about-us/news-events" />
</rule>
</rules>
</rewrite>
</system.webServer>