• WalkingFishPaddleboards

    (@walkingfishpaddleboards)


    After learning that a naked WP domain will have ‘cookieless subdomain’ issues if a CDN is self hosted, I needed / had to switch the root site on my MultiSite to www.

    I followed this guide by:

    1. edit wp-config.php and change
    from
    define(‘DOMAIN_CURRENT_SITE’, ‘example.com’);
    to
    define(‘DOMAIN_CURRENT_SITE’, ‘www.example.com’);

    2. get the search & replace script from https://github.com/interconnectit/Search-Replace-DB and read the instructions on the site on how to use it.

    Everything worked as expected but for accessing the Network Admin Dashboard.

    The dashboards to all the sites (uses sub-domains, not folders) and the permalink structure functions properly within the root site (www.example.com) and the sub-domain sites (subdomain.example.com). But, when I try to access the Network Admin (i.e. https://www.example.com/wp-admin/network/), I get a 302 redirect loop.

    Again, the Dashboards to all the sub-domain sites functions properly but not the Network Dashboard.

    I done some snooping on Google and here WP and on StackOverflow but nothing has worked ( or fits to this situation ). I think this can be fixed in the .htacces but I am not verse in that so any help or suggestions would be greatly appreciated!!

    Below is my configurations:

    .htaccess:

    . . .
        # BEGIN WordPress
    
        <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.php$ - [L]
    
        # Disable trace and track
        RewriteCond %{REQUEST_METHOD} ^TRACE
        RewriteRule .* - [F]
    
        # Forbid Proxy comment posting
        RewriteCond %{REQUEST_METHOD} =POST
        RewriteCond %{HTTP:VIA}%{HTTP:FORWARDED}%{HTTP:USERAGENT_VIA}%{HTTP:X_FORWARDED_FOR}%{HTTP:PROXY_CONNECTION} !^$ [OR]
        RewriteCond %{HTTP:XPROXY_CONNECTION}%{HTTP:HTTP_PC_REMOTE_ADDR}%{HTTP:HTTP_CLIENT_IP} !^$
        RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
        RewriteRule .* - [F,NS,L]
    
        # add a trailing slash to /wp-admin
        RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^ - [L]
        RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
        RewriteRule ^(.*\.php)$ $1 [L]
        RewriteRule . index.php [L]
        </IfModule>
    
        # END WordPress
        . . .

    …and in my config.php:

    . . .
        /* Multisite */
        define('MULTISITE', true);
        define('SUBDOMAIN_INSTALL', true);
        define('DOMAIN_CURRENT_SITE', 'www.example.com');
        define('PATH_CURRENT_SITE', '/');
        define('SITE_ID_CURRENT_SITE', 1);
        define('BLOG_ID_CURRENT_SITE', 1);
    
        define('ADMIN_COOKIE_PATH', '/');
        define('COOKIE_DOMAIN', '');
        define('COOKIEPATH', '');
        define('SITECOOKIEPATH', '');
        . . .
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter WalkingFishPaddleboards

    (@walkingfishpaddleboards)

    If anyone knows the following is a bad idea, plz feel free to comment to why. Thnx!

    I commented line 18 within the …/wp-admin/network/admin.php:

    $redirect_network_admin_request = 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path );

    Obviously I’ll need to do this for each update ?? But until there is a better solution…

    I’ve started having the same problem since I absent-mindedly updated to 4.0.
    Have you found a solution? The only one that works for me (if I need the network admin) is to comment out the define('DOMAIN_CURRENT_SITE', 'xxxxxxx.xx'); row.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘MultiSite Network Admin Redirect Loop After Adding www’ is closed to new replies.