Add a CNAME record that points out the deploy from the development branch

The problem that I have now is how to add a CNAME record that points out the deploy from the development branch of a certain repo to my Netlify DNS zone.
For instance, I would expect https://beta-show.example.com to have the deploy from the development branch while https://show.example.com to have the deploy from the master branch.
I do not want the branch deploy to be something like https://development.show.example.com.
I tried to add a CNAME record manually but that did not work for me. It just did render “Not Found”

I’d like Netlify community to help me figure out this problem
Thanks!

Sorry, your expectations are incorrect.

Branch subdomains MUST match the pattern branchname.yoursitescustomdomain.com - they do not work in any other way (except branchname--yournetlifysitename.netlify.com)

If you want a branch served at another name - you need to create a separate site and configure that branch as the “production” branch, and apply the custom domain you want (which can be any name you control :))

@fool Thanks for your kind response.

I created a separate site and configured the development branch as the “production” branch. I could apply the custom subdomain. but still the problem I have now is that the development branch deploy is running the script for the production. that is because the development branch was set to production in that site. I looked up for how to inject an environment variable into the netlify.toml but only headers and redirects are allowed to be injected.
Can you advise me a solution?

Thanks

That is a tough challenge if you use production context in netlify.toml to use different settings per context.

I guess you could change it to [context.master] and [context.branchname] to separate the two, perhaps?

1 Like

Yes that worked! Thank you, @fool