Knowledge Base
All Categories How to's Microsoft IIS Configuration

Microsoft IIS Configuration

If you are using a Windows web server with IIS installed, the .htaccess won’t work so you need to edit the web.config like this (make sure the rewrite extension is installed on your IIS server  http://www.iis.net/downloads/microsoft/url-rewrite):

<?xml version="1.0"?>
<configuration>
   <system.webServer>
   <defaultDocument>
     <!-- Set the default document -->
      <files>
        <remove value="index.php" />
        <add value="index.php" />
      </files>
    </defaultDocument>
 <httpErrors errorMode="Detailed"/>
  <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>

Was this article helpful?

Thanks for your feedback!