Skip to content

Instantly share code, notes, and snippets.

@vgerbase
Last active August 6, 2017 14:46
Show Gist options
  • Save vgerbase/d8c3deab81adb4a49f78510862c5b816 to your computer and use it in GitHub Desktop.
Save vgerbase/d8c3deab81adb4a49f78510862c5b816 to your computer and use it in GitHub Desktop.
Ensure HTTPS in IIS. Require URL Rewrite module.
<system.webServer>
<rewrite>
<rules>
<rule name="Ensure HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://mydomain.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment