There appears to be a bug on the web.config file generated by WordPress, up to version 4.7.2, where the rewrite rules do not work as needed to access the sites defined in the network.

When using, for instance, sub-dir for the multisites configuration, trying to access mysite.com/subsite/wp-admin/ gives a 404 error.

up vote 2 down vote accepted

As per this issue on the WordPress trac, the problem are the rules 4 and 5.

The solution is to change the url parameter and add 1, so, instead of this:

            <rule name="WordPress Rule 4" stopProcessing="true">
                <match url="^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
                <action type="Rewrite" url="{R:1}" />
            </rule>
            <rule name="WordPress Rule 5" stopProcessing="true">
                <match url="^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                <action type="Rewrite" url="{R:2}" />
            </rule>

You have this:

            <rule name="WordPress Rule 4" stopProcessing="true">
                <match url="^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
                <action type="Rewrite" url="{R:2}" />
            </rule>
            <rule name="WordPress Rule 5" stopProcessing="true">
                <match url="^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                <action type="Rewrite" url="{R:3}" />
            </rule>

Doing this change allows the multisite feature to work.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.