• Hi.

    I need to have my domains use ‘www’ on a new host. Both sites already are using WordPress on another host with the ‘www’ prefix, but we are bringing both sites into a Multisite arrangement on a new host, so need to continue with this.

    In the database, I have wp_site domain value set to domain.com and path value as /

    In wp_options I have siteurl and home set to http://www.domain.com

    In wp_2_options I have siteurl and home set to http://www.otherdomain.com

    In wp_blogs, again i have ‘domain.com’ and ‘/’ as its path and ‘otherdomain.com’ with ‘/’ as its path.

    This all works OK. The frontend works as ‘www.domain.com’ and also redirects ‘domain.com’ to the www equivalent. Perfect.

    However, I have noted in the admin, the My Sites>Network Admin URL is actually http://domain.com/wp-admin/network/ – clicking it forces me to login. I login, I’m back to a working http://www.domain.com/wp-admin/network/ – however, the problem persists any time I do something like install a plugin – I get logged out and must login again, therefore cannot install any plugins without manually changing the URL, for example:-

    http://www.domain.com/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fwp-admin%2Fnetwork%2F&reauth=1

    I need to change the second instance of domain.com to http://www.domain.com then press the login button, otherwise I just go round in circles on the login page.

    Why is this happening?! If I place some echo statements in my template:-

    <?php echo network_admin_url(); ?>
    <?php echo site_url(); ?>

    It produces:-

    http://domain.com/wp-admin/network/
    http://www.domain.com

    So where is this coming from? No changes have been made to the default multisite htaccess rules:-

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Wp-config.php contains:-

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'domain.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Can anyone see the error of my ways? I can fix it by changing ‘DOMAIN_CURRENT_SITE’ in wp-config to ‘www.domain.com’, the URL the Network Admin URL shows correctly in the backend, but cannot login as there is a redirection loop!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Network Admin URL not using 'www'’ is closed to new replies.