marthijn. Rotating Header Image

WordPress IIS URL Rewrite rules

This WordPress blog is installed on an IIS 7.0 webserver. In order to use nice permalinks without index.php in it (such as example.com/2010/01/01/test), a rewrite engine has to be used. Since there is no mod_rewrite for IIS, my web hoster installed Microsoft’s URL Rewrite Module. On this page I found the rules to add in the web.config file.

My web.config is now as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer>
     <rewrite>
       <rules>
         <rule name="Main Rule" stopProcessing="true">
           <match url=".*" />
           <conditions logicalGrouping="MatchAll">
             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
           </conditions>
           <action type="Rewrite" url="index.php" />
         </rule>
       </rules>
     </rewrite>
   </system.webServer>
</configuration>
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply