简体   繁体   English

IIS7 URL重写以根据路径进行重定向

[英]IIS7 URL Rewrite to redirect based on path

Using IIS 7.5 and URL Rewrite 2.0, how would I redirect the following: 使用IIS 7.5和URL Rewrite 2.0,我将如何重定向以下内容:

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

to

https://help.mysite.com/2012/v1.2.3 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. 寻求帮助的道路并不总是2012年,也可能是任何一年。 Same with the v1.2.3; 与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. 这是一个非常常见的场景-这是一篇很棒的文章,其中包含许多图片,将帮助您指导创建用于在IIS 7.5中重写的地图的过程。

http://www.iis.net/learn/extensions/url-rewrite-module/using-rewrite-maps-in-url-rewrite-module 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). 您的其他选项是HttpHandler(模块)或使用UrlRewriting框架(如MVC)。

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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