I'm using IIS 7.5 with URL Rewrite.
I have old legacy urls out on the web that point to urls like this:
http://www.domain.com/games/dog-vs.-cat
http://www.domain.com/games/john.smith-ran-away
I need these urls to be rewritten without the dot:
http://www.domain.com/games/dog-vs-cat
http://www.domain.com/games/johnsmith-ran-away
Here's my rule that is not working.
<rule name="RedirectOldURL" stopProcessing="true">
<match url="^games/([a-zA-Z0-9-]+)$" />
<action type="Redirect" redirectType="Permanent" url="/games/{R:1}" />
</rule>
Is it possible to rewrite the source url without the dot? The dot could appear anywhere in that last piece of url.
Thanks
In action use
<match url="^games/([0-9]+)/([_0-9a-z-]+)" />
and in action block use:
url="games.aspx?id={R:1}&title={R:2}"
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.