Skip to content

Instantly share code, notes, and snippets.

@nickspiers
Created July 15, 2013 19:28
Show Gist options
  • Save nickspiers/6002677 to your computer and use it in GitHub Desktop.
Save nickspiers/6002677 to your computer and use it in GitHub Desktop.
IIS Rewrite remove WWW rule
<system.webServer>
<rewrite>
<rules>
<rule name="Remove WWW" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
</conditions>
<action type="Redirect" url="http://{C:2}{PATH_INFO}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment