I installed Url Rewrite 2.0 and made this redirect according to the instructions. In the web config it turned out like this:

<rewrite> <rules> <rule name="HTTP to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" /> </rule> </rules> 

But an error occurs: TOO MANY REDIRECTS

    1 answer 1

    I usually do this:

      <rule name="http_to_https" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> </rule>