IIS URL 重写 - 如果 URL 包含则忽略
IIS URL Rewrite - ignore if URL contains
我有以下 URL 重写内部设置 web.config 可以正常工作。
<rule name="Product Rewrite" stopProcessing="true">
<match url="^products/([^$]+)/([^$]+)" />
<action type="Rewrite" url="products?durl={R:1}&purl={R:2}" />
</rule>
现在我需要排除任何包含或以 /action/edit 结尾的 URL,即 products/action/edit
我知道我需要一个条件块,但我不确定要写什么。
如有任何帮助,我们将不胜感激。
添加如下条件,否定 true 确保它匹配除 action/edit
之外的所有内容
<conditions>
<add input="{URL}" negate="true" pattern="action/edit" />
</conditions>
我有以下 URL 重写内部设置 web.config 可以正常工作。
<rule name="Product Rewrite" stopProcessing="true">
<match url="^products/([^$]+)/([^$]+)" />
<action type="Rewrite" url="products?durl={R:1}&purl={R:2}" />
</rule>
现在我需要排除任何包含或以 /action/edit 结尾的 URL,即 products/action/edit
我知道我需要一个条件块,但我不确定要写什么。
如有任何帮助,我们将不胜感激。
添加如下条件,否定 true 确保它匹配除 action/edit
之外的所有内容<conditions>
<add input="{URL}" negate="true" pattern="action/edit" />
</conditions>