问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/17734896/iis7-url-rewrite-to-redirect-based-on-path