Swapping a main site to be a subsite, and a main site to be a sub site (14 posts)

  1. richlondon
    Posted 4 years ago #

    I have set up a network of sites. There is currently a main site eg http://www.mainsite.com. I have a subsite called sitetest.mainsite.com.
    I am wanting the sitetest.mainsite.com to become the main site and the http://www.mainsite.com to become the subsite.
    I have noticed this is an issue because when I tried to send someone from sitetest.mainsite.com to the wp-signup.php, they get redirected to http://www.mainsite.com/wp-signup.php.

    I have tried editing the wp-config.php where it says
    define( 'DOMAIN_CURRENT_SITE', 'www.mainsite.com' );
    Then in a SQL dump file doing a find and replace on all instances of http://www.mainsite.com, that kind of works. However sitetest.mainsite.com/wp-signup.php, is never found by the browser.

    Short of creating a new network in the correct order, which is a bit of a pain, as I have many plugins etc configured. Any help would be greatly appreciated.

  2. I have noticed this is an issue because when I tried to send someone from sitetest.mainsite.com to the wp-signup.php, they get redirected to http://www.mainsite.com/wp-signup.php.

    Yeah, that ain't gonna change. The MAIN site is always the master signup. If you swapped 'em out, they'd STILL go to the main site. But you have options!

    Have them register globally then visit the subsite they want to contribute to, where you have this widget:


    Or alternatively (and here's where it might get tricky if you;re using the same theme everywhere) take the wp-signup.php code, stuff it in a page template on the subsites. Tweak as needed.

    Yes they still get added globally to the network, but they also get added to that site at the same time. So a little less visible to the user.

    Remember multisite is like running your own wordpress.com.

  3. richlondon
    Posted 4 years ago #

    Hi Ipstenu,
    Thanks for this. I hadn't thought of that.

    Yep I understand that the main site is always the master signup. I am wondering how I can swap the sites round. So the subsite I change to be the main site, and the old main site to be the sub site.
    example: main brand becomes main site, sub brand becomes sub site. I currently have sub brand as main site. main brand as subsite.

    I might try adding the wp-signup code to a page template, on my virtual machine.

    I'm just wondering if having the sites set up in this way will stitch me up, so I'm looking at ways to change it.

    Thanks for replying.

  4. In your wp-config.php there's a line:

    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Change that to 2, I believe, and it'll switch 'em.

  5. richlondon
    Posted 4 years ago #


    I think that has solved it!

    many thanks for your help...much appreciated!

  6. Do keep tabs on it. I did that and had weird issues with adding new blogs later :)

  7. richlondon
    Posted 4 years ago #

    ah.. when you say weird issues?
    what do you mean?

  8. *re-read my own notes*


    DO NOT change SITE_ID_CURRENT_SITE, just the Blog ID, and you'll be fine :D

  9. richlondon
    Posted 4 years ago #

    ah right. I did that on my virtual machine and it broke.

    so I have noted not to do that either!

    Thanks you've been a great help!

  10. richlondon
    Posted 4 years ago #

    Ah I have found an issue....

    When I add a custom menu item that that has teh address "/wp-signup.php"
    it simply loads the sign up form on the home page.

    I am thinking I will have to create a custom page template that includes the wp-signup code.

    Changing this line define( 'BLOG_ID_CURRENT_SITE', 1 ); has also meant that all my images have disappeared.


  11. richlondon
    Posted 4 years ago #

    I have a slider on the homepage which was loading each time I navigated to the wp-signup.php, as it was part of the header.
    I have fixed this by adding the slider code to the homepage page template rather than having the header check to see if it was the homepage and including teh slider then.

    This now throws up the issue that navigating to http://www.mainsite.com/wp-signup.php (which used to be the subsite), shows on the navigation that the user is on home.

    So after doing a lot of digging around.... I'm thinking the best solution is to simply create a page called register, and have the registration on there. But I don't know how to include the wp-signup.php code onto a normal page. I thought about creating a page template, but again I not sure how to include the code in that!!!

    kind of stuck between a rock and a hard place.

  12. richlondon
    Posted 4 years ago #

    I've had a developement with this issue, however I'm left scratching my head....

    I have tried to add the changes to the live site, however the wp-signup.php is never found and the broswer gets stuck in a redirect loop.
    steps I have taken....
    installed the domain mapping plugin for my site network.
    Added the final domain addres to that (www.btl.com), to the required site, the original domain was websitetest.surpassplatfom.com.
    changed the domain on the indo page of the site in the network admin area.
    changed the ( 'BLOG_ID_CURRENT_SITE', 1 ); to 3 as that is the id of websitetest.surpassplatfom.com.
    This causes the the wp-signup page to never be found.

    If I change the ( 'BLOG_ID_CURRENT_SITE', 1 ); back to 1, then the wp-signup works, but redirects the user to the surpassplatform.com site.

    Do you know what is happening, and after I changed the domain from websitetest.surpassplatfom.com, to http://www.btl.com, i can get the wp-signup page working.

    many thanks


  13. basememara
    Posted 4 years ago #

    Did you ever find clean steps to get this done all the way through? Your experience is greatly appreciated!

  14. basememara - Yes!

    I wrote about it in http://halfelf.org/ebooks/wordpress-multisite-110/ (I think it's page 78 or so). Disclosure: the ebook is pay what you will.

Topic Closed

This topic has been closed to new replies.

About this Topic