不好意思,我搜索了半天,希望有人能帮忙…
如果我有一个格式为{domain}/webinar/Product1的URL,我想重定向到{domain}/webinar/Product2。下面是我的代码(注意:PHP控制器的第二条规则):
<rewrite>
<rules>
<rule name="v2-r1">
<match url="^/webinars/Product1" />
<action type="Redirect" url="/webinars/Product2" appendQueryString="true" />
</rule>
<rule name="Hide-Controller" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
如果有人能指出我需要改变什么,我会非常感激-谢谢。
试试这个,我已经测试过了,请求localhost/webinars/Product1将重定向到localhost/webinars/Product2.
<rules>
<rule name="redirect" stopProcessing="true">
<match url="webinars/Product1" />
<action type="Redirect" url="webinars/Product2" />
</rule>
</rules>