How to replicate Wordpress multisite subdomain structure in Netlify

Hi.

I have a Wordpress multisite that I’d like to migrate to the JAMstack. From what I’ve read a Gatsby/Netlify/Netlify CMS combo looks like a great way to start.

My question is whether I can successfully replicate the subdomain structure I already have.

At mydomain.com there’s a simple menu to select language and then a blog for that language.

1.mydomain.com is the logical home of the blog portal

en.1.mydomain.com has a blog that acts as the menu for the English blogs

blogname1.en.1.mydomain.com is the subdomain for the first English blog. There are more English blogs with a subdomain in the same format each one.

es.1.mydomain.com has a blog that acts as the menu for the Spanish blogs

blognombre1.es.1.mydomain.com is the subdomain for the first Spanish blog. There are more Spanish blogs with a subdomain in the same format each one.

I’m planning to export the blogs to XML and then convert them to markdown with each blog being its own project in Github and its own subdomain in Netlify. For my personal blogs I’m planning to use Netlify CMS, but I’m hoping this approach would allow other bloggers to use things like prose, Ghost and Contenful for theirs.

If replicating this structure is possible then I plan to have other portals at the same domain.

If it is possible I’d really appreciate some guidance on how to go about it. :slight_smile:

Many thanks.

replicating that structure is possible!

We give you a swiss army knife, so there are many ways to handle. Could you tell me more about your workflow in redeploying the content so I can try to give you the most suitable workflow I can think of? I’m looking for details like:

  1. are you willing to manage the sites separately? (I mean, among your example: mydomain.com, 1.mydomain.com, en.1.mydomain.com, blogname1.en.1.mydomain.com - how many separate deployments are you intending/expecting/hoping for?

  2. how many such sites will you have? From your description - many languages? many individual blogname1’s? maybe even multiple mydomain.com’s?

  3. do you need others to help you manage? I can’t tell if you just have a complex blog layout, or you are intending to be a blog PLATFORM for many of your customers who all manage their own content. That could change a lot of the advice we’d give!

  4. If the latter - customers (or even content creators in your company, who will not be managing your netlify sites directly) will manage content - do you intend them to interact directly with Netlify, or instead, via some CMS that you manage, that would trigger updates here?

Hi,

I’m delighted to hear that replicating this structure is possible. I spent a lot of time investigating the JAMstack options available and Netlify was top of my list for lots of reasons.

  1. I’m very willing to manage each of the sites separately. I’m expecting to do one deployment for the menu at the apex domain, 1 more for each language for the blog menus (so 2 at the moment) and then another one for each blog. If each site has its own deployment pipeline then I can configure them to best suit the level of traffic and regularity of updates they each have. I plan to default each one to Gatsby and Netlify CMS. If they’re separate my understanding is I’ll then leave the door open to changing the SSG and/or CMS for each one.

  2. I only intend to have one mydomain.com for production. The number 1 for the blog portal will allow me to have more portals, e.g. 2 for a cue sports portal, 3 for a reviews portal. The 2 letter language code before the portal will allow me to add more and more languages to each portal as the sites grow in popularity. To start with I’ll just have the blogs portal with 2 languages (English and Spanish) with a menu blog at each. There are 5 content blogs in English and 1 in Spanish.

  3. My intention is to provide a service where each blogger manages their own content, ideally via the CMS of their choice. And for tech savvie bloggers the SSG of their choice too. For the other portals I’ll be building the English content, but I’ll want the flexibility to add other languages either as direct translations or as equivalent content. This will be taken on a portal by portal basis. For the blogs portal some blogs may never get translated or have equivalents, so the blog content for each language will grow independently.

  4. I’m intending to link up the CMS that content editors use (default Netlify CMS) via webhooks with Netlify, so that they are free to focus on building content. My understanding is that each change could be set up to trigger an atomic deploy. The bloggers I’m working with at the moment are all ex-colleagues. My plan is to continue adding blogs by people I know until the deployment pipeline has been fully established. Once that happens I hope to open the doors a bit wider. I’ll follow a similar route for the other portals, starting them off in house, adding in content editors I know, then opening things up further.

If my answers have raised more questions then please feel free to ask me them before solutionising. I really appreciate you taking the trouble to give me considered advice. It’s exactly what I was hoping for.

Thanks.

hey fobano, this seems like an interesting project you are spinning up! We (support team) can definitely give you our take, but, it might be more helpful to chat with one of our solutions engineers who can probably give you a better/bigger picture for all of these things. Is it OK if someone from that team reaches out to you?

Hi Perry

I certainly think it’s interesting. :slight_smile: Is there any chance you could do both, i.e. give me the support team’s take and then also put me in touch with one of the solution engineers? That way I’ll have a better feel for the possible approaches when I get to talk with the solution engineer.

Hi Perry and Chris,

If there is a way to do what I’m proposing I’d really love to get going with it.

Please could you get me started?

Apologies for being so slow to get back to you!

Reason for the delay is that we’ve talked about this extensively and the question is pretty broad - we can’t talk you through exactly how to do it; we can only tell you what is possible and suggest some tools you could use. At a high level, the tools would be Netlify / your SSG / your headless CMS - so we’ll leave you to choose a CMS and SSG, and just advise on Netlify. Good news: this pattern is in frequent use across our customer base today :slight_smile:

Specific followups to your points:

  1. You should be able to (but do not have to) host the CMS + the gatsby part of the site in a single netlify site.

  2. As you seem inclined already, you’ll probably want to use a separate site for each blog portal, or instead use country-based redirects to split traffic to one site automatically. I think you probably want the separate sites since what you REALLY want is language-based redirects as described in that doc, but I can’t recommend them as they don’t currently work as well as they could, but that is a possibility that will be unlocked in coming months by some feature work we’re doing on our redirects service, and/or this feature: https://www.netlify.com/products/edge/edge-handlers/
    This would only make sense for the single site with multiple translations, as I see it. But if your codebase for 1.mydomain.com and 2.mydomain.com etc are all the same, you may be able to use a single site to handle serving those - we have a feature where *.yourdomain.com is served by a single site (and your client side javascript “shows different things” baed on the hostname - e.g. is smart enough to show client1logo.png vs client2logo.png based on the hostname alone).

  3. I don’t know of any good / Netlify-compatible internationalization tools to help with that, but I am sure some are out there. Should be possible today though!

  4. the default with the CMS is that indeed, each publish (there is a possibility to have a draft/review/published [editorial workflow](Configuration Options | Netlify CMS | Open-Source Content Management System where not every save republishes the production site).

Some additional guidance:

  • since you are reselling netlify as a hosting platform, you will need a Pro or higher account with us to avoid violating our terms of service
  • shouldn’t be any systemic limitations to mix/matching ssg’s and CMS’s - you’ll have to configure & debug the connections, but it is a frequent use pattern in our customers that work well
  • you may like to look into templating with a “Deploy to Netlify” button or other file-based configuration in case you end up with multiple repositories with your SSG/frontend code in. Won’t need to have multiple repos for your setup, since you can have multiple repos for content all associated with a single repo for the code, as long as everyone is using the same SSG with the same settings - but your long term plans do sound like you’ll benefit to some degree from this.

Let me know if you have any specific followup questions such as “ok, I tried setting up what you described like ABC and XYZ happened” or “could you show me an example country redirect for this pattern?” and I’ll be happy to help!

Hi Chris/fool,

Thanks ever so much for getting back to me. No need to apologise, I really appreciate your help with this.

I’ve spent my time reading up about all the links you gave me and I’ve learnt a lot in doing so, thanks.

Unfortunately, I wasn’t in a position to try anything out just yet. You’re correct that my query was a pretty broad one. Maybe if I try to narrow down some of the parameters to clarify what I need to get started that will help.

I have a site menu at the root domain, 3142.xyz, where the first level of the menu is the languages available and the second level shows the options for the selected language. This is a lot like the way Wikipedia asks for you to choose a language and then takes you to the articles for that language. I lived in Spain for 9 years, so I’ve heard first hand how annoying auto-language and auto-country detection can be for people. I don’t want to replicate that. I’d like to ignore country-based redirects for now and leave the site visitor free to choose.

The content in each blog portal will grow at its own rate, again like Wikipedia. It won’t simply be a translation from the English like a lot of sites. So I’m ok without internationalisation tooling for now.

So I don’t think I’ll need any redirects setting up in the manner you’ve suggested. I’d like visitors to typically start at the root, select a language and then move around the site using url links.

What I need to do to get going is migrate the blogs away from the Digital Ocean droplet they’re on at the moment. For all those blogs I’ll use Gatsby / Netlify / Netlify CMS. I’ll worry about using different SSGs and CMSs later.

So I need to be able to put the site menu at the root domain, the Pi Blogs menu at en.1. root, each of the English blogs at their own subdomain within that, e.g. clowiescorner.en.1. root, the Los blogs de Pi at es.1. root and Sueños hechos realidad at suenoshechosrealidad.es.1. root.

So it feels to me like I need to be able to deploy code to 10 different URLs. Is that right? If so, how do I achieve that?

The site is still up and running for you to take a look if it helps.

I have no intention of violating your terms of service. None of my ex-colleagues has paid me a penny to host their blogs. It’s not my intention to charge anyone new that uses my site to host their blog. If that changes in the future I would upgrade straight away. One of the reasons I chose Netlify is that it allows you to start for free with a package that lets you fully test out your ideas and then the first tier of pricing is reasonable to keep that momentum going with out having to switch provider.

Having narrowed the scope significantly, and shared the specific site details so it’s much easier for you to see where my starting point is, I’m hoping you’ll be able to help me get going with the migration asap.

By the way, should I call you Chris or fool?

hey fobano,

so glad you are getting some good pointers out of this conversation! That said, we’re sort of at a bit of a limit on how much more we can assist with this process - there are only 7 support engineers for hundreds of thousands of customers worldwide, and so this is reaching outside of the scope of support we can really provide.

That said, your questions are totally valid - and I’m going to connect you with someone in a different department who can continue this conversation with you! I do hope that netlify ends up working out as the platform you use to build your project.

-Perry

Thanks Perry. Looking forward very much to hearing from your colleague.

Hi Perry. I’m still hoping to use Netlify, but I’m afraid I really will need the help you offered to make that possible. When do you think your colleague will be able to continue this conversation?

hey @fobano - sorry to be slow to get back to you. Did you hear from one of our team by now?

if not - lets make sure we have the right email address for you.

Hi Perry,

The only Netlify person I’ve heard from so far is Shafali Raj in Business Development and they just expressed their interest in keeping up to date with my project.

My email is fobano@tuta.io

I’m pretty sure you have that correct as I’m replying to you from my email account.

Still hoping you can arrange for someone to help me get going.

Many thanks,

Fobano