Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gregjhogan/2ca4b4ea07f83554f899f75aae50fc88 to your computer and use it in GitHub Desktop.

Select an option

Save gregjhogan/2ca4b4ea07f83554f899f75aae50fc88 to your computer and use it in GitHub Desktop.
IIS web.config for redirecting HTTP -> HTTPS
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="redirect HTTP to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment