Can't create CNAME record for www so that www.(mywebsite) will resolve.
I tried to have a CNAME record with the name WWW that pointed to my website but it isn't working. I am using Cloudflare pages so my real domain lets call it example.com is pointing to example.pages.dev but I want it so that www.example.com will resolve to example.com (aka: example.pages.dev) however I cannot get it to work.
14 Replies
What did you put as the target for the cname for the subdomain www?
For a cname the host should be www and the target should be example.com
This is what I did i believe:
so this is my real domain (points too the pages site)
and this is the www.domain
Does the domain without www work?
It looks right to me.
Without it works yes
But with the w it doesn’t
Might just be propagation then. How long has it been since you added it?
1-2 days
cloudflare is usually so fast about it so thats why i made this post
but the website without the www works perfectly 🤷♀️
I wonder if pages is bound by hostname
i dunno if you can cname to a cname
can you also point the cname for www to example.pages.dev?
and add the www domain to your project
https://community.cloudflare.com/t/dns-cname-www-record-error-code-522/418069/2
another thought would be to deploy a redirect rule for www traffic to hit root instead https://developers.cloudflare.com/rules/url-forwarding/examples/redirect-www-to-root/
Cloudflare Docs
Redirect from WWW to root | Cloudflare Rules docs
Create a redirect rule to forward HTTPS requests from the WWW subdomain to the root (also known as the “apex” or “naked” domain).
I tried to do it to pages but maybe I set that one up wrong
Redirects I would assume to work tbh.