Skip to content

Instantly share code, notes, and snippets.

@fedek6
Created June 19, 2018 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedek6/f35dec7cddfa62d9f1aacb840b38bce7 to your computer and use it in GitHub Desktop.
Save fedek6/f35dec7cddfa62d9f1aacb840b38bce7 to your computer and use it in GitHub Desktop.
Force https on IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Force HTTPS" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://website.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment