• Resolved agrajagco

    (@agrajagco)


    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.

    • This topic was modified 8 years, 2 months ago by agrajagco.
    • This topic was modified 8 years, 2 months ago by agrajagco.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter agrajagco

    (@agrajagco)

    An update to this, we proved it is not redirecting in the hosting, the site actually works, ONLY wp-admin calls are redirecting!!!!

    <mindblown>

    not working (redirected when calling / or wp-admin)
    174.XX.XX.XX – – [21/Sep/2016:20:48:28 -0700] “GET / HTTP/1.1” 301 – “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36”
    174.XX.XX.XX – – [21/Sep/2016:20:48:40 -0700] “GET /wp-admin/ HTTP/1.1” 302 – “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36”

    working (actual call to site content!!!)
    174.34.135.242 – – [22/Sep/2016:20:52:33 -0700] “GET /about/ HTTP/1.0” 200 16591 “-” “Mozilla/5.0 (compatible; MJ12bot/v1.4.5; https://www.majestic12.co.uk/bot.php?+)”

    I’m assuming this is in the wp DB at this point? is there a database primer on the wp multi-network and its relationship to inbound request handling?

    Thread Starter agrajagco

    (@agrajagco)

    Good news was able to fix, it appears that we set the base url of the site (too many cooks in the kitchen) before switching over the DNS

    Great article on Changing a MultiSite Primary Domain, gave walk through of the significant database tables to be paying attention to.

    Note that:
    Your base install tables will be named like wp_options, wp_posts, etc. Our fix was in adjusting the wp_options siteurl value back (which probably had been mis-set in UI before cutting over to the new erz.net.

    Your “networks” tables will have table sets that have naming like 4_wp_posts or whatever incremental network/site you are up to.

    Changing that wp_options siteurl value back to the original example.com fixed things.

    Thread Starter agrajagco

    (@agrajagco)

    Also worthy content going through WP Multi-Network in a developer presentation by John James Jacoby.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing default site in multi-network’ is closed to new replies.