IIS7重写地图正则表达式? [英] IIS7 Rewrite Map Regex?
问题描述
是否可以在重写地图中使用reg ex?例如:
Is it possible to use reg ex in a rewrite map? For example:
<rewriteMap name="Redirects">
<add key="/blah/(.*)" value="/blah/{R:1}" />
</rewriteMap>
或者有办法处理这种方法吗?目前,我有一个规则设置匹配所有内容,然后使用重写映射映射到新的URL。我想捕获目录下的所有内容,例如资源文件(等等)...无需手动为它们全部执行此操作。
Or is there a way to handle this approach? Currently, I have a rule set up to match on everything and then use the rewrite map to map to new urls. I would like to capture everything under a directory e.g. resource files (blah)... without having to manually to do this for them all.
推荐答案
不幸的是没有,你会需要创建一个规则来使用正则表达式。
Unfortunately not, you'll need to create a rule to use regular expressions.
请注意,密钥及其
关系中没有明显的共同模式价值观。这意味着无法使用常规的
表达式或通配符来定义URL转换逻辑。
http ://www.iis.net/learn/extensions/url-rewrite-module/using-rewrite-maps-in-url-rewrite-module
这篇关于IIS7重写地图正则表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!