Clarification about adding websites

Hi,

I’m trying to find out whether it is allowed to add a root domain and a subdomain of the same root as separate websites in Cloudflare . i.e.:

  1. website 1 - test.com
  2. website 2 - stage.test.com

Is the above valid configuration or does a single website have to be configured for both test.com and stage.test.com?

Thanks in advance.

Greetings,

Thank you for asking.

The root domain can be added to Cloudflare.

You can add a sub-domain on behalf of having the root domain added or not, but only as a CNAME setup and this might require a higher paid plan, or at least you could add it as an option and a part of the SSL for SaaS as I remember. Could be I am wrong.

The best case scenario and I would advise you to do so, is to add test.com domain to your Cloudflare account.

Therefore, add an DNS record for the A stage hostname (as a sub-domain) and point to to the right IP address where it is being hosted.

May I suggest below articles for help with getting started with Cloudflare for your domain name.

Hi,

Thank you for the explanation.

What I really need to know is whether it is a valid configuration to have test.com and stage.test.com as separate websites. Or whether these must be in a single website.

The reason for this is that we want to have separate Cloudflare settings for production and for staging environments.

Thanks,

You can have it as a “single” domain being added to Cloudflare.
test.com hostname can be proxied :orange: and use all the Cloudflare features (or the ones you need and want to use), while stage.test.com doesn’t have to use any of Cloudflare features at all while being :grey: (DNS-only) or can be too proxied and :orange: but using Page Rules you define what you want.
Nevertheless, using Firewall Rules you can restrict access and even more.

You can also configure this separately with Cloudflare Page Rules.

  • SSL for each of them, optimizations, firewall protection, etc.

I am sorry, but I might be missing a point of view from your perspective and do not see a point adding sub-doiman along with the root domain to Cloudflare as a “separate” properties while they both can be “under one”, despite different configurations needed to be used due to the development/production phase.

Again, I’ve manage 70s websites, both being in dev/prod stages.
I only add root domain to Cloudflare.
Therefore, configure everything for the “root” production one.
And then I manage the “stage” hostname as I need, proxy or unproxy it, restrict access to it only for the devs team, remove speed/code/image optimizations, disable HTTPS for it, enable them back to see if JS code works well with auto-minify options, or if the stage sub-domain is working over SSL correctly, etc.

Sure, it is valid. A lot of customers have it like that too. True, it might cost something if so and could be I am wrong about it.

You might want to wait for a reply from someone else more experienced than me about it. Thank you for patience.

Thank you for more clarification and appreciate your prompt response.

Hi there,

I did some more digging on it and it appears the solution is described here:
https://support.cloudflare.com/hc/en-us/articles/360026440252-Understanding-Subdomain-Support

tested and working fine.

Thanks again for help

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.