使用 IIS Url Rewrite,是否可以使用 RewriteMaps 匹配通配符 URL?例如,我有以下重写规则:
<rule name="Disable access except for RewriteMap URLs" enabled="true" stopProcessing="true">
<conditions>
<add input="{Allowed Urls:{URL}}" pattern="1" negate="true" />
</conditions>
<match url="(.*)" />
<action type="Redirect" url="http://{HTTP_HOST}" />
</rule>
它使用以下 RewriteMap:
<rewriteMap name="Allowed Urls">
<add key="/products" value="1" />
<add key="/products/product-1" value="1" />
<add key="/products/product-2" value="1" />
</rewriteMap>
我想修改我的 RewriteMap 以包含通配符 URL,因此我有一个add
与以下 URL 匹配的元素:
/products/id/1
/products/id/2
/products/id/3
/products/id/4
这样的事情可能吗?