Skip to content

Instantly share code, notes, and snippets.

@mxmissile
Created September 3, 2014 20:55
Show Gist options
  • Save mxmissile/019294152da407ca52f1 to your computer and use it in GitHub Desktop.
Save mxmissile/019294152da407ca52f1 to your computer and use it in GitHub Desktop.
Rewrite rule for IIS rewrites everything to https
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
courtesy of Sides of March
http://www.sidesofmarch.com/index.php/archive/2014/09/02/forcing-iis-to-rewrite-all-requests-to-https/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment