• Hiya all,

    I have an odd problem. I had an old site at example.com and recently created a new site (in a multisite network) at a subdomain called blog.example.com

    The new site works fine, and I’ve now deleted the old site at the root url. I’m currently using a simple ‘redirect’ to send users to the subdomain (blog.example.com) each time they ask to access the root url.

    Everything works, but . . .

    I’d like to somehow move my new site back onto the root domain (so there’s no need for any redirect etc) Is there an ‘easy’ way to do it? (I have space on the server to clone the current site if needed)

    Many thanks for any solutions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    Nothing is easy about multisite. Moving it isn’t too different than single site, except there’s a lot more things to check. The step-by-step looks complex, but it’s really not that bad. You do need to be careful and meticulous, and be sure everything is backed up just in case.
    https://codex.www.ads-software.com/Moving_WordPress#Moving_Directories_On_Your_Existing_Server

    and just for multisite (same page, different section):
    https://codex.www.ads-software.com/Moving_WordPress#Moving_WordPress_Multisite

    This is all to move the entire site. If you really just want one sub-site moved, you probably are best off cloning the entire thing, then deleting the sites you don’t want.

    Thread Starter apto

    (@apto)

    Thanks for the info – but I think things might have become over-complicated. I don’t want to move any WP core files etc etc. All is fine as it is. I just want users to be sent to the root domain (i.e. example.com) rather than the subdomain (i.e. blog.example.com) when they access the site. As I mentioned. I’m currently using a 303 re-direct so that the opposite happens – when they type example.com the re-direct sends them instead to blog.example.com – but that’s a bit inelegant. I want to revert back to using the plain old root domain for the site. (btw there’s only one site in operation, the one on the subdomain)

    Moderator bcworkz

    (@bcworkz)

    I think I’m still missing something then. Why not just remove the redirect?

    Thread Starter apto

    (@apto)

    Thanks bcworkz ,

    I could leave things as they are, but it looks and feels odd to have users sent to blog.example.com when they expect the site to be at the root domain i.e example.com Just to recap, there’s no WP site configured at the main root domain – and I don’t understand how to clone the subdomain site (or simply move it).

    Moderator bcworkz

    (@bcworkz)

    OK, I think I’m tracking now. Ideally, you’d move everything to root, but it’s a bit involved. It makes the most sense though. The easy alternative is to add another redirect for root domain requests to go to the WP install folder, thus both www and blog subdomains all go to the same place. The drawback is you’d need to explicitly redirect any added sites because of WP’s subfolder location. You’d actually have a subfolder type network with subdomain redirects disguising that fact.

    Assuming your DNS supports wildcard subdomains, I think it’s worth moving the site to root because you can then add sites on the fly without needing to add redirects. It’s basically just moving files, but you do need to go back in and adjust a bunch of links to remove the subfolder from the paths. Even that’s not too bad. What gets tricky is if any path information is contained in serialized arrays. You don’t want to attempt to manually edit these. You need to use one of the search/replace scripts mentioned in #11 of the first link of my original reply. FWIW, I like to use the Databases Script (interconnect/it) linked last.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cloning sub site to root url’ is closed to new replies.