Changing default site in multi-network
-
WP Multi Network install
All domains map to / in the hosting configuration
(obviously all domains are example, sorry if I’m pointing at something real)
Original default (before multi-network plugin) was “example.com”, then additional networks were built in place for foo.com, boo.com, goo.com, and erz.net
Now erz.net is our primary domain in the hosting (e-mail, and other reasons).
The working assumption was because domains were staying the same and everything was working before starting, that both would be fine.
The new default domain works (we can reach erz.net/wp-admin)
But we have lost the ability to attach to example.com/wp-admin, it gets immediately redirected to erz.net/wp-admin/.
Examining what is going on with developer tools in the browser, we see an immediate 302 redirect being hammered and the user ends up with the following URL on the wrong (new) domain.
https://erz.net/wp-login.php?redirect_to=http%3A%2F%2Fexample.com%2Fwp-admin%2F&reauth=1
I have tried setting the wp-config to change the CURRENT_SITE. It should be noted that historically we commented out DOMAIN_CURRENT_SITE and have run this way for a while just fine. SO we have in wp-config.php:
define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); $base = '/'; # define('DOMAIN_CURRENT_SITE', 'example.com'); define('PATH_CURRENT_SITE', '/'); # site 1 is example.com #define('SITE_ID_CURRENT_SITE', 1); #define('BLOG_ID_CURRENT_SITE', 1); # site 21 is erz.net define('SITE_ID_CURRENT_SITE', 21); define('BLOG_ID_CURRENT_SITE', 21); define('WP_ALLOW_MULTISITE', true);
I’ve also attempted to use the following in the wp-includes/functions.php
remove_action( 'template_redirect', 'redirect_canonical' );
But this did not work (we got an error page to appear, but only by forcing an incorrect “path” to the network in the “edit network” dashboard for all networks (exiting example.com from that).
How do we stop this? example.com’s content is not significant at this point (but we do need to import new content into it, just cant get to its wp-admin).
I think I can use the All-in-One WP Migration tool to overwrite the site (I think?) given it supports multi-network…. but this is a stop and sort it out before doing things kind of moment.
Any feedback appreciated.
- The topic ‘Changing default site in multi-network’ is closed to new replies.