IIS7 URL Rewrite to redirect based on path

大兔子大兔子 提交于 2019-12-13 04:38:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!