We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

View Complete Thread
  • Re: http > https redirect bypasses my farm

    Feb 22, 2021 03:50 PM|NovaDev|LINK

    I stumbled upon the rule below, and that seems to do the trick. I don't know why this works, but I'm glad it does. 

    <rule name="redirect" enabled="true" stopProcessing="true">
        <match url=".*" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
             <add input="{HTTP_HOST}" pattern="test.mydomain.org" />
             <add input="{SERVER_PORT}" pattern="^80$" />
             <add input="{HTTP_X_ARR_SSL}" matchType="Pattern" pattern=".*" ignoreCase="true" negate="false" />
         </conditions>
         <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" redirectType="Found" />
    </rule>