• Resolved Potz

    (@potz)


    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.

Viewing 1 replies (of 1 total)
  • manuluize

    (@manuluize)

    I’m having the very same problem.
    I made this change, now my homepage is working, but all the other pages and posts keeps with the “500 Internal Server Error”. My website is hosted with Go Daddy on a Windows hosting and they don’t provide support for scripting or when one is using subdomains, like I am.

    Any help?

    This is how my web.config code is now:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
    			<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="{R:2}" />
    			</rule></rules>
        </rewrite>
      </system.webServer>
    </configuration>

    My Links:
    https://manuluize.com
    Any other page, for example: https://manuluize.com/lancamento-verao-2015-da-dimy-curitiba/ shows the 500 Internal Server Error.

Viewing 1 replies (of 1 total)
  • The topic ‘Solved: web.config error in subfolders multisite’ is closed to new replies.