Skip to content

Instantly share code, notes, and snippets.

@CGaskell
Created December 10, 2016 08:16
Show Gist options
  • Save CGaskell/ceefd6b49cb6e1e78b65642e9b48a539 to your computer and use it in GitHub Desktop.
Save CGaskell/ceefd6b49cb6e1e78b65642e9b48a539 to your computer and use it in GitHub Desktop.
IIS Rewrite Rule - Redirect HTTP requests To HTTPS
<rewrite>
<rules>
<rule name="Redirect to https" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" negate="false" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
</rule>
</rules>
</rewrite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment