简体   繁体   English

IIS urlrewrite:重写规则vs rewriteMap

[英]IIS urlrewrite: rewrite rule vs rewriteMap

I have been using url rewrite for sometime and I have always and only used rules and I have always got what I need. 我一直在使用url重写并且我一直只使用规则而且我总是得到我需要的东西。 There is also rewritemap in there. 那里还有重写地图。 what is the difference between rewrite rule and rewritemap? 重写规则和重写映射有什么区别?

Doesn't rewrite rules map one link to another? 不重写规则将一个链接映射到另一个链接? Isn't it considered mapping? 是不是考虑了映射?

A rewrite map is an arbitrary collection of name and value pairs that can be used within rewrite rules to generate a substitution URL during rewriting. 重写映射是名称和值对的任意集合,可以在重写规则中用于在重写期间生成替换URL。 Rewrite maps are particularly useful when you have a large set of rewrite rules and all of these rules use static strings (that is, when there is no pattern matching used). 当您有大量重写规则并且所有这些规则都使用静态字符串时(即,没有使用模式匹配时),重写映射特别有用。 In those cases, instead of defining a large set of simple rewrite rules, you can put all the mappings into the rewrite map–as keys and values–between the input URL and the substitution URL. 在这些情况下,您可以将所有映射放入重写映射(而不是输入URL和替换URL之间的键和值),而不是定义大量简单重写规则。 Then, to look up the substitution URL based on the input URL, you will have one rewrite rule that references this rewrite map 然后,要根据输入URL查找替换URL,您将有一个引用此重写映射的重写规则

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

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