Skip to content

Instantly share code, notes, and snippets.

@bdukes
Created February 28, 2019 20:33
Show Gist options
  • Save bdukes/77103455ba8c61d2fb165a98f47004ad to your computer and use it in GitHub Desktop.
Save bdukes/77103455ba8c61d2fb165a98f47004ad to your computer and use it in GitHub Desktop.
URL Rewrite rule to redirect from HTTP to HTTPS
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect HTTP to HTTPS" stopProcessing="true">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="^OFF$"/>
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment