Redirect 针对HTTPS和HTTP的IIS重定向

Redirect 针对HTTPS和HTTP的IIS重定向,redirect,iis,url-rewriting,Redirect,Iis,Url Rewriting,我正在尝试设置一个重定向,该重定向将检测是否使用https并将流量重定向到,以及是否使用http将流量重定向到 我目前正在使用IIS重写 我尝试过做一些事情,但没有成功。您可以使用以下规则: <rule name="Redirect with HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions><add input="{HTTPS}" pattern="^ON$"

我正在尝试设置一个重定向,该重定向将检测是否使用https并将流量重定向到,以及是否使用http将流量重定向到

我目前正在使用IIS重写


我尝试过做一些事情,但没有成功。

您可以使用以下规则:

<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>

请阅读-总结是,这不是向志愿者讲话的理想方式,可能会对获得答案产生反作用。请不要将此添加到您的问题中。