/ Published in: ASP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <rewrite> <rules> <rule name="CanonicalHostNameRule1" stopProcessing="true"> <match url="^(\w*/)?default\.aspx" /> <conditions> <add input="{HTTP_HOST}" pattern="domain\.com$" /> </conditions> <action type="Redirect" url="http://www.domain.com/{R:1}" /> </rule> <rule name="CanonicalHostNameRule2" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^domain\.com$" /> </conditions> <action type="Redirect" url="http://www.domain.com/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration>