Why did installing wordpress in url root jack up underlying WP sites?

In each of the web.config files for each directory, they will look much like this:

<rewrite>
    <rules>
        <rule name="wordpress" stopProcessing="true">
            <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>

For each sub-site, you need to change the rule name and add a clear element. Example:

<rewrite>
    <rules>
      <clear />
        <rule name="SOME DIFFERENT NAME HERE" stopProcessing="true">
            <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>

WordPress will not do this for you because it doesn’t know about any other sites on your system, and IIS configuration is very complicated. As I explained in comments, WordPress’s support for IIS is extremely limited at present. You need to really write these config files yourself if you have any sort of system other than a single site configuration, and for that, you need to find an expert who knows IIS, not necessarily one who knows WordPress in particular.

Leave a Comment