Home
Support Forums

CMS - multiple subdomains

Hello everyone. I have a question related to multiple domains or subdomains that will be referred to 1 site only. Also need to support dev and stage environments.

We have a React application, let’s say a CMS, which is supposed to work for different customers on different subdomains.

For example, the app is going to be deployed to myapp.com which is a root domain, and simultaneously it should be deployed to all subdomains that we want to specify, for each client separately. For example we have clients: client1, client2 and client3. So we need our app deployed to:

client1.myapp.com
client2.myapp.com
client3.myapp.com

All these subdomains should refer to our single React app. And we want to have such clients and subdomains as many as we want.

And actually, I think the root domain myapp.com will not be used ever, so only subdomains make sense, the app logic is based on each subdomain, and only subdomains are going to be used as main URLs for users. That’s my concern about is my understanding is correct, or no. I mean, should I consider root domain myapp.com and multiple subdomains (if my root domain will not be used) or should I consider multiple root domains, like client1.myapp.com & client2.myapp.com & client3.myapp.com are separate root domains without having a myapp.com… Please help me to understand what is the right way…

Right now, we have our app set up to Firebase hosting, so we have domains (client1.myapp.com, client2.myapp.com ..etc) on Firebase hosting, but Firebase have their own limitation up to 20 subdomains, but we want to have more. So, I’m looking for a platform where we can do that.

Is it possible with Netlify?

And a last point, in addition to multiple subdomains, we need to have their DEV and STAGE environments. So in total if we have 3 PROD clients and 3 subdomains:

client1.myapp.com
client2.myapp.com
client3.myapp.com

we also need to have

client1.dev.myapp.com
client2.dev.myapp.com
client3.dev.myapp.com

and

client1.stage.myapp.com
client2.stage.myapp.com
client3.stage.myapp.com

or somethings like this.

Currently in firebase, we have created 3 different firebase projects for that, so PROD with all subdomains is a 1st project, DEV and STAGE with related subdomains is 2nd and 3rd projects.

Is it possible too via Netlify? And how it will be handled? via different projects/sites?

Hi @flackery,

That’s an interesting question. While you’ve done a great job explaining your use case, I might not have understood it fully, so feel free to post any follow-up questions till you’re not sure if migrating from Firebase to Netlify is the correct way to go for you.

So, even if my app.com will never be used, I think it it’s easier to connect that to Netlify. The benefit of using apex domain with Netlify DNS is that, you could easily request a wildcard domain + SSL, and the DNS configuration would be managed automatically. But if you are comfortable with managing the DNS yourself, you could totally just connect the required subdomains.

Also, I think you should create each client’s website as an individual website. It would be easier to manage. We do allow unlimited websites, but have a soft limit to prevent spam. The limit is fairly high (around 500). You can easily get this limit raised by contacting support. So, that’s one thing to know.

You can also add the required stage and dev domains, but I think it should be stage.client1.myapp.com rather than the other way round. That’s just my opinion, and won’t make a difference. But yes, it’s this specific configuration why I would recommend using Netlify DNS with wildcard domains as you need nested subdomains.