Created
May 24, 2017 07:52
-
-
Save Phuseos/f469713678b6270de1d9be7e728bcf02 to your computer and use it in GitHub Desktop.
(XML) Web.Config rewrite rule to auto-redirect to HTTPS
This file contains hidden or 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"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<clear/> | |
<rule name="Redirect to https" stopProcessing="true"> | |
<match url="(.*)"/> | |
<conditions> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true"/> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false"/> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment