Solved: web.config error in subfolders multisite
-
Hi,
since I had trouble finding a solution online for this one, I thought I would share the one that finally worked for me.
I host WordPress (4.0) on a IIS 7.0 server. When I configured multisite (using subdirectories), I first thought everything went well, since I could access the Network admin dashboard, etc. But when I tried to access the dashboard of one of the sites, I got a 404 error. It turned out no contents from any site was available. I knew something was wrong in the URL rewriting, which under Windows takes place in the web.config file.
I took me a while to solve it, mainly because of the lack of documentation on a Windows WordPress multisite installation. I could find a ton of posts on .htaccess configuration, but almost nothing on web.config.
I finally dug out a three-year old post that pointed me in the right direction.
There was a problem with Rule 4 (or, since the numbering is bound to change from version to version, with the rule rewriting the URLs for the wp-content, wp-admin and wp-includes folders).
The original web.config as written by WordPress had this syntax:
<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>
But the “R:1” points toward the wrong part of the expression. I therefore simply replaced R:1 by R:2 and everything went instantly fine.
I hope this post can spare a few nosebleeds to some Windows users out there.
- The topic ‘Solved: web.config error in subfolders multisite’ is closed to new replies.