我正在尝试设置一个重定向,它将检测是否使用https,并将流量重定向到https://example.com.au,如果使用http,则将流量重定向到http://123.com.au。
我目前正在使用IIS重写。
我试着做了几件事,但没有效果。
发布于 2017-07-25 13:42:29
您可以使用以下规则来实现此目的:
<rule name="Redirect with HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions><add input="{HTTPS}" pattern="^ON$" />
</conditions>
<action type="Redirect" url="https://example.com.au/{R:1}" />
</rule>
<rule name="Redirect without HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions><add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="http://123.com.au/{R:1}" />
</rule>
https://stackoverflow.com/questions/45293490
复制相似问题