• Resolved gregorywolf

    (@gregorywolf)


    Hello – I realize that there have been many posts about this topic. I have diligently reviewed about 2 dozen thinking that I would be able to find a solution. But no luck. Let me begin by describing my install environment:

    Running WP 3.7.1 on Windows Server 2008 R2, IIS 7.5. My WordPress core files are stored at c:\wordpress. WordPress is added as an application under the lawnside.com site in IIS, which makes is accessible via lawnside.com/wordpress/. My web root web folder is physically installed on a UNC called \\readynas\lawnside. I have created an internal web site (not accessible via the Internet) called lawnside.com. I have started by creating a standalone WP installation and everything works perfectly. I then modified web-config.php file to include the line:

    define( ‘WP_ALLOW_MULTISITE’, true);

    Then after logging backing WP, I installed a multisite network and added the following to my web-config.php:

    define(‘MULTISITE’, true);
    define(‘SUBDOMAIN_INSTALL’, false);
    define(‘DOMAIN_CURRENT_SITE’, ‘lawnside.com’);
    define(‘PATH_CURRENT_SITE’, ‘/’);
    define(‘SITE_ID_CURRENT_SITE’, 1);
    define(‘BLOG_ID_CURRENT_SITE’, 1);

    I also added the system generated rewrite statements to web.config.

    After logging out and then back in I poked around on my one installed site and it looks fine – I can use all of the WP links fine. The problem is that when I go to My Sites -> Network Admin, the associated URL being called is lawnside.com/wp-admin/network/ which fails since the correct URL is lawnside.com/wordpress/wp-admin/network/

    Again I have reviewed all of the forum threads. I have even wiped out the entire installation and started from scratch. Any help/direction for things to look for would be MUCH appreciated. I am at a loss right now on the what else to look for to fix the issue.

    Thank you in advance.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    So … lawnside.com/wordpress is NOT what you put in here:

    define('DOMAIN_CURRENT_SITE', 'lawnside.com');
    define('PATH_CURRENT_SITE', '/');

    Shouldn’t that be this?

    define('DOMAIN_CURRENT_SITE', 'lawnside.com');
    define('PATH_CURRENT_SITE', '/wordpress/');
    Thread Starter gregorywolf

    (@gregorywolf)

    Hello. I actually tired this based on another forum entry. After making this change I get an error in my browser telling me “Error establishing a database connection”

    Thread Starter gregorywolf

    (@gregorywolf)

    In doing some further digging I have retrieved the following:

    get_admin_url() = http://lawnside.com/wordpress/wp-admin/

    network_admin_url() = http://lawnside.com/wp-admin/network/

    So it appears that the value of the network_admin_url() is not getting set correctly. Where does it get set?

    Thread Starter gregorywolf

    (@gregorywolf)

    I have confirmed that ALL plugins are disabled and have tried activating the 2010 theme. Still no luck. When I need to use the Network admin portion of the WP installation for testing of this problem, I simply manually edit the URL. Just an FYI.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    I also added the system generated rewrite statements to web.config.

    Can you show us what those are?

    Thread Starter gregorywolf

    (@gregorywolf)

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

    (@gregorywolf)

    Sorry for first upload of sloppy code

    Thread Starter gregorywolf

    (@gregorywolf)

    I also just noticed something. On the banner next the the WP logo there is the My Sites pull down which exposes the Network Admin and the Lawnside site. The URLs for My Sites and the Lawnside site are correct. It is ONLY the Network Admin URL that is incorrect.

    Thread Starter gregorywolf

    (@gregorywolf)

    I am still trying to fix this issue. I have found a post that is very similar to my situation –
    http://wordpress.org/support/topic/menu-links-for-network-admin-missing-directory-for-wordpress

    I am now trying to play with the rewrite rules in wp.config but so far no luck.

    Thread Starter gregorywolf

    (@gregorywolf)

    Well after MUCH searching I found a way to fix the situation. However, it does break the golden rule – NEVER HACK the CORE. With that said let me explain the fix. The file called linl-template.php in c:\wordpress\wp-includes\ The original code is as follows:

    function network_admin_url( $path = '', $scheme = 'admin' ) {
    	if ( ! is_multisite() )
    		return admin_url( $path, $scheme );
    
    	$url = network_site_url('wp-admin/network/', $scheme);
    
    	if ( $path && is_string( $path ) )
    		$url .= ltrim($path, '/');
    
    	return apply_filters('network_admin_url', $url, $path);
    }

    If I make the following change

    $url = network_site_url('wordpress/wp-admin/network/', $scheme);

    Everything works!! The problem is that this is not the best approach. The better approach is to modify PATH_CURRENT_SITE in wp-config.php in \wordpress directory but when that happens I get an error telling me that a database connection cannot be established.

    Has anyone been able to solve this situation….???

    Thread Starter gregorywolf

    (@gregorywolf)

    The file is actually called link-template.php

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    The problem is your server’s not passing /wordpress/ in there for some reason, but I don’t know enough about how you jiggered your install to even begin to unravel this.

    IF you have wordpress in domain.com/wordpress and you’re accessing it from there, then everything should be relative and just fine.

    That they are NOT relative means generally

    1) Your .htaccess/web.config file is wrong
    2) You gave WP it’s own directory incorrectly
    3) Your vhosts (or the equivilent) is somehow goofed.

    But you’re on IIS and my understanding of that and Multisite is nill.

    Thread Starter gregorywolf

    (@gregorywolf)

    I have done a fresh install and things are working properly

    I have the exact same problem is there a non-hacky solution to this problem?

    I’m trying some rewrite rules in the htaccess file but no luck so far.

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.

    I am now closing this 7 month old topic as it references an older version of WordPress & has been resolved.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Network Admin pointing to the wrong URL’ is closed to new replies.