Last active
December 13, 2015 22:59
-
-
Save kyranjamie/4988916 to your computer and use it in GitHub Desktop.
ASP.NET - Remove www prefix with 301 redirect to root domain.
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
<rewrite> | |
<rules> | |
<rule name="Remove WWW prefix" > | |
<match url="(.*)" ignoreCase="true" /> | |
<conditions> | |
<add input="{HTTP_HOST}" pattern="^www\.domainname\.co.uk" /> | |
</conditions> | |
<action type="Redirect" url="http://domainname.co.uk/{R:1}" redirectType="Permanent" /> | |
</rule> | |
</rules> | |
</rewrite> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment