943 characters | 24 lines | 943 Bytes
DOWNLOAD | RAW | EMBED | CREATE NEW VERSION OF THIS PASTE | REPORT ABUSE | x
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3.   <system.webServer>
  4.      <modules runAllManagedModulesForAllRequests="true" />
  5.         <rewrite>
  6.             <rules>
  7.                 <rule name="CanonicalHostNameRule1" stopProcessing="true">
  8.                   <match url="^(\w*/)?default\.aspx" />
  9.                     <conditions>
  10.                         <add input="{HTTP_HOST}" pattern="domain\.com$" />
  11.                     </conditions>
  12.                    <action type="Redirect" url="http://www.domain.com/{R:1}" />
  13.                 </rule>
  14.                 <rule name="CanonicalHostNameRule2" stopProcessing="true">
  15.                     <match url="(.*)" />
  16.                     <conditions>
  17.                         <add input="{HTTP_HOST}" pattern="^domain\.com$" />
  18.                     </conditions>
  19.                     <action type="Redirect" url="http://www.domain.com/{R:1}" />
  20.                 </rule>
  21.             </rules>
  22.         </rewrite>
  23.   </system.webServer>
  24. </configuration>