简体   繁体   English

IIS 批量旧版重定向

[英]IIS Bulk legacy redirects

I have several dozens of urls which need to be redirected, and I don't want to create a rule for each of them and I cannot group them.我有几十个需要重定向的网址,我不想为每个网址创建规则,也无法对它们进行分组。 Each url has its own redirect.每个 url 都有自己的重定向。

Is there a way in IIS to create a rule in which I put all these redirects? IIS 中有没有办法创建一个规则来放置所有这些重定向?

Thanks谢谢

  1. Open IIS打开 IIS
  2. Assuming you have URL Rewrite module installed, double click on it假设你安装了 URL Rewrite 模块,双击它
  3. On the right side, on Actions, under Manage Server Variables there's View Rewrite Maps.在右侧,在操作上,在管理服务器变量下有查看重写映射。
  4. On the right side, Add Rewrite Map, Fill in a proper name (eg: LegacyRedirects)在右侧,添加 Rewrite Map,填写正确的名称(例如:LegacyRedirects)
  5. Open the newly created rewrite map, and on the right side, there's "Add Mapping Entry":打开新建的rewrite map,右侧有“Add Mapping Entry”:

Original value: source (eg: /contact-us/europe/germany) New value: destination (eg: /)原始值:来源(例如:/contact-us/europe/germany) 新值:目的地(例如:/)

The above example redirects the traffic from the page with source path to the root page.上面的示例将流量从具有源路径的页面重定向到根页面。

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

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