Skip to content

Instantly share code, notes, and snippets.

@andrenascentes
Created January 26, 2018 08:43
Show Gist options
  • Save andrenascentes/d8ba410cee2f1dff288015d6087bde06 to your computer and use it in GitHub Desktop.
Save andrenascentes/d8ba410cee2f1dff288015d6087bde06 to your computer and use it in GitHub Desktop.
IIS url rewrite http to https
<rewrite>
<rules>
<rule name="Rewrite HTTP to HTTPS" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" />
</rule>
</rules>
</rewrite>
@andrenascentes
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment