2011-09-13 51 views
4

我尝试从这个网址rewitre的价值...IIS 7 URL重写 - 获得查询字符串

/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> 

我回来的URL是/VehicleAdvert/tella/Friend?vehicle=285584

什么即时通讯之后是 - >/VehicleAdvert/tella/Friend/285584

任何人都可以提出哪里即将出错?

在此先感谢:)

Truegilly

回答

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>