Last active
August 6, 2017 14:47
-
-
Save vgerbase/7a901f85f4f3d9376ddea57e5af3a42a to your computer and use it in GitHub Desktop.
Remove WWW and ensure HTTPS in IIS. Require URL Rewrite module.
This file contains hidden or 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
| <system.webServer> | |
| <rewrite> | |
| <rules> | |
| <rule name="Remove WWW and Ensure HTTPS" stopProcessing="true"> | |
| <match url="(.*)" /> | |
| <conditions logicalGrouping="MatchAny"> | |
| <add input="{HTTP_HOST}" pattern="^(www\.)" /> | |
| <add input="{HTTPS}" pattern="^OFF$" /> | |
| </conditions> | |
| <action type="Redirect" url="https://mydomain.com/{R:1}" /> | |
| </rule> | |
| </rules> | |
| </rewrite> | |
| </system.webServer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment