• Hi,
    I have set up a network of sites. There is currently a main site eg https://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 https://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 https://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 https://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.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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 https://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:

    https://www.ads-software.com/extend/plugins/add-users-sidebar-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.

    Thread Starter richlondon

    (@richlondon)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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.

    Thread Starter richlondon

    (@richlondon)

    WOW!

    I think that has solved it!

    many thanks for your help…much appreciated!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

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

    Thread Starter richlondon

    (@richlondon)

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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    *re-read my own notes*

    Aha!

    DO NOT change SITE_ID_CURRENT_SITE, just the Blog ID, and you’ll be fine ??

    Thread Starter richlondon

    (@richlondon)

    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!

    Thread Starter richlondon

    (@richlondon)

    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.

    cheers

    Thread Starter richlondon

    (@richlondon)

    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.

    However….
    This now throws up the issue that navigating to https://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.

    Thread Starter richlondon

    (@richlondon)

    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 https://www.btl.com, i can get the wp-signup page working.

    many thanks

    rich

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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    basememara – Yes!

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

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Swapping a main site to be a subsite, and a main site to be a sub site’ is closed to new replies.