• Hi all

    We are migrating all our sites at https://www.example.com over to separate WordPress Network installs but in order to have 1 WordPress install centrally to manage these I need to have WordPress installed in the root of https://www.example.com.

    I have WordPress working fine in https://www.example.com which can be accessed via https://www.example.com/index.php including WordPress admin etc but when I try to access https://www.example.com/subsite1/ I get redirected to https://www.example.com/index.php even through subsite 1 is set up as a WordPress site.

    NOTE: https://www.example.com/subsite1/index.php works ok.

    The current web.config looks like this:

    <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="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />
      <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />
    </rule>
    
    <rule name="WordPress Rule 3" stopProcessing="true">
    <match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />
    <action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />
    </rule>
    
    <rule name="WordPress Rule 4" 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 5" 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 6" stopProcessing="true">
     <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
     <action type="Rewrite" url="{R:2}" />
    </rule>

    As I have existing .aspx, .asp and .html content in this root I can’t have the standard catch all to make WordPress kick in or set the default document to be index.php so I was trying to have something like the following:

    <rule name="WordPress Engine Rule" stopProcessing="true">
     <match url="^subsite1/.*)" ignoreCase="true" />
     <action type="Redirect" url="subsite1/index.php" />
    </rule>

    Any help greatly appreciated!

  • The topic ‘IIS 7.5 WordPress Network install URL Rewrite Module 2.0’ is closed to new replies.