Skip to content

Instantly share code, notes, and snippets.

@macna
Created April 18, 2015 21:11
Show Gist options
  • Save macna/e55cefc932a2708d12ab to your computer and use it in GitHub Desktop.
Save macna/e55cefc932a2708d12ab to your computer and use it in GitHub Desktop.
A snippet from a Microsoft Internet Information services web.config file that enables HTTP requests to be redirected to HTTPS. Requires that the rewrite module is installed.
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment