• I’ve setup WP multisite with subdomain method recently and my domain looks like this: https://sub.domain.com so my sites would looks like *.sub.domain.com … (subdomain of subdomain) everything working well so far.

    for this reason our SSL certificate which covers *.domain.com doesn’t support *.sub.domain.com So we decided to use sub directory method.

    I changed wp-config.php multisite configs like this:

    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'staff.rightel.ir');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    and changed web.config rewrite rules:

    <rewrite>
      <rules>
        <rule name="HTTP to HTTPS redirect" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
          </conditions>
          <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
        </rule>
        <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:2}" />
        </rule>
        <rule name="WordPress Rule 6" stopProcessing="true">
          <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
          <action type="Rewrite" url="{R:2}" />
        </rule>
        <rule name="WordPress Rule 7" stopProcessing="true">
          <match url="." ignoreCase="false" />
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>

    also changed site settings:
    main site domain : sub.domain.com ; path: /
    other site domain : sub.domain.com ; path: /hr

    But now the problem is when I try to access sites https://sub.domain.com/hr it redirects me to not found page of main site, it behave like https://sub.domain.com/hr is a page that doesn’t exist instead of navigate to /hr site

    can you please help me ?

  • The topic ‘subdirectory multisite in IIS 7.5’ is closed to new replies.