我需要一个正则表达式,可以匹配所有https URL,但排除特定路径。
例如:
匹配
https://www.domain.com/blog https://www.domain.com
不匹配
https://www.domain.com/forms/*
这是我目前为止的成果:
<rule name="Redirect from HTTPS to HTTP excluding /forms" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{URL}" pattern="^https://[^/]+(/(?!(forms/|forms$)).*)?$" />
</conditions>
<action type="Redirect" url="http://{HTTP_HOST}/{R:0}" redirectType="Permanent" />
</rule>
但它不起作用