1073 characters | 30 lines | 1.05 KB
DOWNLOAD | RAW | EMBED | CREATE NEW VERSION OF THIS PASTE | REPORT ABUSE | x
  1. <configuration>
  2.   <system.webServer>
  3.     <rewrite>
  4.       <rules>
  5.         <rule name="CanonicalHostNameRule2" stopProcessing="true">
  6.           <match url="(.*)" />
  7.             <conditions>
  8.               <add input="{HTTP_HOST}" pattern="^domain\.com$" />
  9.             </conditions>
  10.             <action type="Redirect" url="http://www.domain.com/{R:1}" />
  11.         </rule>
  12.         <rule name="CanonicalHostNameRule1" stopProcessing="true">
  13.           <match url="^(\w*/)?index\.php" />
  14.             <conditions>
  15.               <add input="{HTTP_HOST}" pattern="domain\.com$" />
  16.             </conditions>
  17.             <action type="Redirect" url="http://www.domain.com/{R:1}" />
  18.         </rule>
  19.         <rule name="wordpress" patternSyntax="Wildcard">
  20.           <match url="*" />
  21.             <conditions>
  22.               <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  23.               <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  24.             </conditions>
  25.             <action type="Rewrite" url="index.php" />
  26.         </rule>
  27.       </rules>
  28.     </rewrite>
  29.   </system.webServer>
  30. </configuration>