Created
January 18, 2021 18:05
-
-
Save amirkhan81/89eb6783c57bbf9d0750a48302576e0b to your computer and use it in GitHub Desktop.
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
<rules> | |
<rule name="Remove www" stopProcessing="true"> | |
<match url="(.*)" ignoreCase="true" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{HTTP_HOST}" pattern="^www\.(.+)$" /> | |
</conditions> | |
<action type="Redirect" url="http://{C:1}/{R:0}" appendQueryString="true" redirectType="Permanent" /> | |
</rule> | |
<rule name="HTTP to HTTPS redirect" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> | |
<add input="{HTTP_HOST}" pattern="localhost" negate="true" /> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /> | |
</rule> | |
<rule name="domainredirect" stopProcessing="true"> | |
<match url=".*" /> | |
<conditions logicalGrouping="MatchAny"> | |
<add input="{HTTP_HOST}" pattern="^(www.)?currentdomain.com$" /> | |
</conditions> | |
<action type="Redirect" url="https://newdomain.com/{R:0}" /> | |
</rule> | |
</rules> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment