WordPress + Web.config “not found” error on home page

I was trying to setup wordpress on IIS when i faced this problem. I placed a web.config file with given xml code and pretty urls (permalinks) worked fine on all page except the home page. Home page gave a Not Found error while pretty permalinks worked find on all other pages. After adding the following code (given below) in system.webServer settings to web.config it worked find. In short the code given below adds index.php as a default document root.

      <remove value="index.php" />
      <add value="index.php" />

After adding the above code my working web.config looked like:

[xml]<?xml version="1.0" encoding="UTF-8"?>
            <remove value="index.php" />
            <add value="index.php" />
          <rule name="wordpress" patternSyntax="Wildcard">
             <match url="*" />
                  <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                  <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
               <action type="Rewrite" url="index.php" />

Leave a Reply