我试图从这个网址重新开始......
/Search/VehicleDetails.aspx?vehicle=285584
到这个
/VehicleAdvert/tella/Friend/285584
到目前为止,我一直在玩规则,并且有这个,这不起作用......
<!-- Tell a Friend -->
<rule name="Tell a Friend" stopProcessing="true">
<match url="^.*(?:Search/VehicleDetails.aspx).*$" />
<conditions>
<add input="{QUERY_STRING}" pattern="vehicle=.*" />
</conditions>
<action type="Redirect" url="/VehicleAdvert/tella/Friend" redirectType="Permanent" appendQueryString="true" />
</rule>
我回来的网址是/VehicleAdvert/tella/Friend?vehicle=285584
后面是什么 - &gt; /VehicleAdvert/tella/Friend/285584
任何人都可以建议我哪里出错?
提前感谢:)
Truegilly
答案 0 :(得分:9)
这解决了它
<!-- Tell a Friend -->
<rule name="Tell a Friend" stopProcessing="true">
<match url="^.*(?:Search/VehicleDetails.aspx).*$" />
<conditions>
<add input="{QUERY_STRING}" pattern="vehicle=(\d+)" />
</conditions>
<action type="Redirect" url="/VehicleAdvert/tella/Friend/{C:1}" redirectType="Permanent" appendQueryString="false" />
</rule>