我在网站上设置了以下规则,将http重定向到https。但我们刚刚发现,我们的应用程序只提交了一个http api。在我们能够更新之前,我需要让网站忽略对/api文件夹的调用,并只重定向其他所有内容。我相信有一种方法可以说如果URL不包含/api/,则重定向。
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>