Support » Networking WordPress » SubSite/Dashboard Not Working on IIS 8

  • Resolved xmatter

    (@xmatter)


    I have WP installed on IIS 8 for my company’s intranet. I just followed all instructions for changing from WP to WPMU and it went fine. I reactivated all the plugins, themes, plugins, etc…

    The problem is, I cannot access the second site. I can’t access it’s dashboard either. I verified Pretty Permalinks, and I even did the steps LISTED HERE. I have also tried this from wpbeginner:

    define('SUBDOMAIN_INSTALL', false);

    line in wp-config.php file with

    define('SUBDOMAIN_INSTALL', 'false');

    None of these steps worked. I was hoping someone may have some insight. Here is my webconfig:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <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="^intranet/([_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="^intranet/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
                        <action type="Rewrite" url="intranet/I:/intranet/{R:1}" />
                    </rule>
                    <rule name="WordPress Rule 5" stopProcessing="true">
                        <match url="^intranet/([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                        <action type="Rewrite" url="intranet/I:/intranet/{R:2}" />
                    </rule>
                    <rule name="WordPress Rule 6" stopProcessing="true">
                        <match url="." ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>

    I changed the Rule 5 back to R:2. If more information is needed, please ask. When I look at others webconfig, they only have the match url="^" whereas during my install, I have url="^intranet/"

    <rule name="WordPress Rule 5" stopProcessing="true">
                        <match url="^intranet/([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                        <action type="Rewrite" url="intranet/I:/intranet/{R:2}" />
Viewing 6 replies - 1 through 6 (of 6 total)
  • here is my wp-config:

    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true );
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'IP ADDRESS HERE');
    define('PATH_CURRENT_SITE', '/intranet/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    I forgot to add that I receive a “The page isn’t redirecting properly” error whenever I try access the dashboard on front facing site.

    Hi
    I had the same problem, it’s solved now
    add the provided htaccess code on the top of the file, just after # BEGIN WordPress

    IIS does not use a htaccess file. But I did manage to get this to work by using this:

    <rule name="WordPress Rule 4" stopProcessing="true">
                        <match url="^intranet/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
                        <action type="Rewrite" url="{R:1}" />
                    </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>

    Take note on Rule 5 (compared to Rule 4. I had to remove parts of the match url and also change R:2 to R:1.

    What I don’t understand, is that during the network install of WP, it prompts to copy two specific code snippets. The snippet for wp-config is fine, but the webconfig is incorrect. There seems to be enough information out there about users having issues with this and IIS, maybe the WP engineers will correct this down the road to include the correct code snippet for IIS setups.

    Just wanted you to know — I was in the same situation and your solution (fixing rules 4 and 5) worked perfectly for me. Thanks for posting; I really appreciate it!

    That’s great to hear @despeaux

    Glad I helped at least 1 person with WP and IIS… it is a tricky combo to make it function properly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘SubSite/Dashboard Not Working on IIS 8’ is closed to new replies.