When hosting a WordPress site under IIS you can run into some troubles when not getting things set-up exactly right.  I thought I’d post up the configuration file I use for enabling this.  The exact variables for your situation may var depending on the structure of your permalinks.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <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/{R:0}"/></rule>
            <rule name="wordpress" patternSyntax="Wildcard">
                <match url="*"/>
                    <conditions>
                        <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>
    <defaultDocument>
      <files>
        <clear/>

        <add value="index.php"/>
      </files>
    </defaultDocument>
  </system.webServer>
</configuration>

Shopify
Anti-Virus - BitDefender

Leave a Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.