IIS rewrite rules to redirect www.yourdomain.com to yourdomain.com
<?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to non-www" stopProcessing="true"> <match url="(.*)" negate="false"></match> <conditions> <add input="{HTTP_HOST}" pattern="^yourdomain\.com$" negate="true"></add> </conditions> <action type="Redirect" url="http://yourdomain.com/{R:1}" redirectType="Permanent"></action> </rule> </rules> </rewrite> </system.webServer> </configuration>
|