IIS7 URL重写以基于路径进行重定向

问题描述:

使用IIS 7.5和URL Rewrite 2.0,我将如何重定向以下内容:

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

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

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

寻求帮助的道路并不总是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.

谢谢.

这是一个非常常见的场景-这是一篇很棒的文章,其中包含许多图片,将帮助您指导创建用于在IIS 7.5中重写的地图的过程.

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

您的其他选项是HttpHandler(模块)或使用UrlRewriting框架(如MVC).

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

希望有帮助.