wordpress and magento web.config file for Microsoft IIS

Windows server did not Use .htaccess Its use web.config for same work that done by htaccess.

Default WordPress .htaccess equivalent in Web.config

1
2
3
4
5
6
7
8
9
10
11
12
<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/{R:0}" />
     </rule>
 </rules>
</rewrite>

Magento .htaccess equivalent in Web.config

1
2
3
4
5
6
7
8
9
<rule name="Imported Rule 1" stopProcessing="true">
  <match url=".*" ignoreCase="false" />
  <conditions>
    <add input="{URL}" pattern="^/(media|skin|js)/" ignoreCase="false" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
  </conditions>
  <action type="Rewrite" url="index.php" />
</rule>

Leave a Reply