简体   繁体   中英

IIS7 URL Rewrite to redirect based on path

Using IIS 7.5 and URL Rewrite 2.0, how would I redirect the following:

https://main.mysite.com/help/2012/v1.2.3

to

https://help.mysite.com/2012/v1.2.3

And the part of the path after help will not always be 2012, it could be any recent year. Same with the v1.2.3; it's a version number so it will change.

Thank you.

This is a pretty common scenerio - here is a great article with lots of pictures that will help guide you through the process of creating a map for rewriting in IIS 7.5.

http://www.iis.net/learn/extensions/url-rewrite-module/using-rewrite-maps-in-url-rewrite-module

Your other options are a HttpHandler (module) or using a UrlRewriting framework (like MVC).

Hope that helps.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM