• Has anyone successfully able to get a WP Multisite using the sub-directory method working when its installed inside a subfolder and not root? For example it would be installed like:
    /root/sites/
    https://www.mywebsite.com/sites

    That way I can create all my multisites sites and their urls would be like:
    https://www.mywebsite.com/sites/test-site-1
    https://www.mywebsite.com/sites/test-site-2

    I think it’s possible and its only a matter of configuring the web.config. By default, WP provides the following and to put these rules in /sites/web.config:

    <rule name="WordPress Rule 1" stopProcessing="true">
    	<match url="^index\.php$" ignoreCase="false" />
    	<action type="None" />
    </rule>
    <rule name="WordPress Rule 2" stopProcessing="true">
    	<match url="^sites/([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />
    	<action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />
    </rule>
    <rule name="WordPress Rule 3" stopProcessing="true">
    	<match url="^" ignoreCase="false" />
    	<conditions logicalGrouping="MatchAny">
    		<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
    		<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
    	</conditions>
    	<action type="None" />
    </rule>
    <rule name="WordPress Rule 4" stopProcessing="true">
    	<match url="^sites/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
    	<action type="Rewrite" url="sites/{R:1}" />
    </rule>
    <rule name="WordPress Rule 5" stopProcessing="true">
    	<match url="^sites/([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
    	<action type="Rewrite" url="sites/{R:2}" />
    </rule>
    <rule name="WordPress Rule 6" stopProcessing="true">
    	<match url="." ignoreCase="false" />
    	<action type="Rewrite" url="index.php" />
    </rule>
    

    Which I think is close, but its assuming that the website may be in root? Putting the rules in /sites/web.config appears to make no difference. So I’ve been putting the rules following modified rules within the root web.config. Here’s my modification but still not working.

    <rule name="WordPress Rule 1" stopProcessing="true">
    	<match url="^sites/index\.php$" ignoreCase="false" />
    	<action type="None" />
    </rule>
    <rule name="WordPress Rule 2" stopProcessing="true">
    	<match url="^sites/([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />
    	<action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />
    </rule>
    <rule name="WordPress Rule 3" stopProcessing="true">
    	<match url="^" ignoreCase="false" />
    	<conditions logicalGrouping="MatchAny">
    		<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
    		<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
    	</conditions>
    	<action type="None" />
    </rule>
    <rule name="WordPress Rule 4" stopProcessing="true">
    	<match url="^sites/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
    	<action type="Rewrite" url="sites/{R:1}" />
    </rule>
    <rule name="WordPress Rule 5" stopProcessing="true">
    	<match url="^sites/([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
    	<action type="Rewrite" url="sites/{R:2}" />
    </rule>
    <rule name="WordPress Rule 6" stopProcessing="true">
    	<match url="sites/." ignoreCase="false" />
    	<action type="Rewrite" url="sites/index.php" />
    </rule>

    I can get to the Multisite dashboard and everything within the admin is working for /sites/ but I’m not able to see the website of websites (test-site-1 and test-site-2) I created nor access their dashboard.

    I’m doing this on Azure, but it would be similar to IIS if not the same. I can also confirm that there is no rules conflict with any other rules.

    Any help would be appeciated

Viewing 3 replies - 1 through 3 (of 3 total)
  • Man, I hope you get a solution to this. I’ve been struggling for two days to get this same scenario working on my IIS server. What’s frustrating is the whole process *appears* to work – no errors, database tables are updated, welcome email is generated – but the site itself just ain’t there. Grrrrrr!!

    Thread Starter qwerks

    (@qwerks)

    Still no luck. We may be going to a Linux stack which I believe will resolve the issue. There’s some examples of doing this with .htaccess, but not with IIS/Azure and the web.config.

    Unfortunately, the default one-click install that comes in the Azure Portal installs WordPress under root which isn’t what we want so the configuration I found there wasn’t all that helpful.

    hey man did you ever solve it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Installing WordPress Multi-site Sub-Directory Within A Sub-folder On IIS/Azure’ is closed to new replies.