Skip to content

Instantly share code, notes, and snippets.

@augustoproiete
Created May 12, 2011 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save augustoproiete/968347 to your computer and use it in GitHub Desktop.
Save augustoproiete/968347 to your computer and use it in GitHub Desktop.
Redirect www to Non-www using URL Rewrite Module 2.0
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RedirectWwwToNonWww">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^yourwebsite\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://yourwebsite.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment