I am trying to make a rule for URL rewrite in IIS all day long,but none of my rules are working ..
I want to make rewrite url to transform for these types of Url
http://localhost:2811/Search/S%2fqIMmjstZg%3d/VehicleDetails.aspx
To http://localhost:2811/Search/VehicleDetails.aspx?mid=S%2fqIMmjstZg%3d
http://localhost:2811/Search/yYut%2f%2fBrHa8%3d/VehicleDetails.aspx
To http://localhost:2811/Search/VehicleDetails.aspx?mid=yYut%2f%2fBrHa8%3d
http://localhost:2811/Search/nNLApdJeWJI%3d/VehicleDetails.aspx
To http://localhost:2811/Search/VehicleDetails.aspx?mid=nNLApdJeWJI%3d
with following rewrite rules
<rewrite>
<rules>
<rule name="QueryString">
<match url="^Search/([_0-9a-z-%=\+\$]*)$/VehicleDetails.aspx" />
<action type="Rewrite" url="Search/VehicleDetails.aspx?mid={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
But its not working..Help Please!!!
You have wrong patten. I suggest you following:
/Search/([^/]*)/VehicleDetails.aspx$
Now explanation (from end)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.