Redirecting www to root

Hi. (1) I'm setting up a blog which suggests setting a root CNAME - https://docs.bearblog.dev/custom-domains/ (2) The docs linked above also say - "If you are using Cloudflare, ensure the proxy (the orange cloud) is turned off." (3) Above steps are fine to set everything up - but if I want to create a page rule to redirect all www.example.com traffic to the root example.com I believe the domain needs to have Cloudflares proxy turned on / enabled which confilcts with what the docs say in (2) above. (4) Any suggestions for setting up the blog on the root of domain and turning the proxy off - but still being able to send everything www to the root? Thanks!
ʕ ꈍᴥꈍʔ Bear docs
Custom domains
Adding custom domains to your Bear blog
6 Replies
Isaac McFadyen
Isaac McFadyen14mo ago
That's interesting. Usually there's no way to add a root CNAME because of the way DNS works. The way Cloudflare gets around it is by internally "translating" the CNAME to an A record for you. So I'm not sure how they intended you to add a root CNAME not on Cloudflare
Problems setting a root CNAME
Ah, I see. They give you an A record. So I assume they want you to turn the proxy Off (grey-cloud) because they issue an SSL certificate. But indeed point "3" is correct, you need to have the proxy enabled to use any Rules. You could try with the proxy and see if it works? I assume the reason is because they use HTTP validation for SSL, which won't work with the proxy on.
arcorun
arcorunOP14mo ago
Think you are correct about the SSL aspect - I do think that requiring the proxy to be turned off means I'll run into issues regardless but I'll play around with it and see what works (or breaks!) 🙂
Erisa
Erisa14mo ago
You can do HTTP validation with proxy on, it just sometimes requires futzing with rules (e.g. you can make .well-known/acme-challenge or similar paths have a rule to disable ssl or use flexible for that path) thats usually why they recommend not using proxy, because otherwise they have to know and explain a workaround
Isaac McFadyen
Isaac McFadyen14mo ago
I think you have to turn proxy off and then have a rule to turn it on everywhere except .well-known? Or at least, that's for Always Use HTTPS
Erisa
Erisa14mo ago
You cant selectively turn off proxy on a path but Always Use HTTPS, yes whether you need that, the ssl setting or some other weird setting combination depends what exactly their HTTP validation is doing but theres usually a way then you have to remember to keep those rules in place so it renews later
arcorun
arcorunOP14mo ago
The more I look into it the more trouble it seems to be, going to look for an alternative for this one I think - thanks for the feedback and input 🙂
Want results from more Discord servers?
Add your server