Skip to content

Instantly share code, notes, and snippets.

@uzbekdev1
Created January 8, 2022 17:33
Show Gist options
  • Save uzbekdev1/3530af08bb7e4f8e82d565392d1eaf43 to your computer and use it in GitHub Desktop.
Save uzbekdev1/3530af08bb7e4f8e82d565392d1eaf43 to your computer and use it in GitHub Desktop.
force HTTPS .net project redirection
<system.webServer>
<rewrite>
<rules>
<rule name="https redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" />
</rule>
</rules>
</rewrite>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment