Skip to content

Instantly share code, notes, and snippets.

@jeremypage
Last active March 11, 2020 15:35
Show Gist options
  • Save jeremypage/58c8554242fe12ef0bf2 to your computer and use it in GitHub Desktop.
Save jeremypage/58c8554242fe12ef0bf2 to your computer and use it in GitHub Desktop.
IIS web.config: Redirect all traffic to HTTPS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Force HTTPS" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" 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