Created
September 4, 2019 11:04
-
-
Save faridprogrammer/a1ad5572bb3a0a71806fe778dfad46ce to your computer and use it in GitHub Desktop.
Force SSL without www
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rewrite> | |
<rules> | |
<rule name="Force non-WWW" enabled="true" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAny"> | |
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" /> | |
</conditions> | |
<action type="Redirect" url="https://{C:2}/{R:1}" appendQueryString="true" /> | |
</rule> | |
<rule name="Force HTTPS" enabled="true" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAny"> | |
<add input="{HTTPS}" pattern="off" /> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" /> | |
</rule> | |
</rules> | |
</rewrite> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment