My website site name is : coucool.netlify.app
I’m trying to configure my website on Netlify to make it work in the following way :
My develop branch pointing to : develop.cou.cool (staging)
My main branch pointing to : cou.cool (production)
My cou.cool domain is registered on an external DNS (and I can’t use Netlify DNS). I just added the A entry to my external DNS to point to Netlify load balancer.
I also added a CNAME entry to setup my staging subdomain like so : develop 3600 IN CNAME develop—coucool.netlify.app. (by reading your documentation).
I have 3 questions :
Is everything okay in my setup ?
Could you please setup SSL for my develop.cou.cool subdomain ?
If your answers to my first 2 questions are positive, does that mean that pushing to develop branch will automatically update my staging website and pushing on my main branch will do the same on production (which is exactly what I want) ?
Seems like DNS is optimally setup to me! I can also see that somehow you already (perhaps with someone else’s help?) got the branch subdomain into the certificate so I think we’re all set here - the site should show production build on cou.cool and your staging build on develop.cou.cool - but please let me know if that’s not what you are seeing, or if I can help with anything else!
Hi @yonitou , welcome back to the forums! Please can you give this handy link a read to see if you can setup this redirect on your own?
Once setup and configured you will be able to manage, declare and add to redirect with netlify.toml
If you are still having issues please share your site name, where you are getting stuck and more details on what you are need help with? Screenshots will be helpful.
I’m not sure to understand … I’m already using static redirects with the _redirects file in my website but I’m not sure it can work for what I’m asking.
To be more precise : My staging website is correctly hosted at develop.cou.cool. I want that www.develop.cou.cool redirects to develop.cou.cool (www to non www). For me, it should be done in my DNS provider but I’m not sure what the CNAME entry should be. Do you understand better what I want ?
Sam’s advice was one piece of how to fix it on our system - you could fix it at your DNS provider but we really don’t recommend it. Here’s what I’d do in great detail:
add a new domain alias for www.develop.cou.cool here: Netlify App
configure it same as www.cou.cool in your DNS provider (CNAME to same site)
then create the redirect Sam was mentioning, and deploy it. Note: this should go at the very top of your _redirects!
I did exactly what you said and it’s “almost” working. To be clear :
The redirection is working
But when I try to access to https://www.develop.cou.cool, my browser (Chrome) is yelling because the SSL certificate is not valid (you can try it on your side). Did I miss something ?
I think we’re not far from the solution
You’re all set! The subdomain www.develop.cou.cool has been added to your site’s SSL certificate. It’s been tested and is loading successfully & securely in my browser