jasonbin icon

IIS URLRewrite HTTP to HTTPS

jasonbin | PRO | 12/20/16 10:14:31 AM UTC | 0 ⭐ | 284 👁️ | Never ⏰ | []
VBScript |

510 B

|

None

|

0 👍

/

0 👎

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
        <match url="(.*)" />
        <conditions logicalGrouping="MatchAny">
          <add input="{HTTPS}" pattern="off" />
        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Comments