Created
December 5, 2017 19:58
-
-
Save ginomessmer/f6b05f7b627bf4cf76f69391710e8420 to your computer and use it in GitHub Desktop.
Redirect HTTP to HTTPS on IIS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="{SERVER_PORT_SECURE}" pattern="^0$" /> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" /> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment