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
David Wang
David Wang2mo ago
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
Xonestly
XonestlyOP2mo ago
This is what I did i believe:
Xonestly
XonestlyOP2mo ago
so this is my real domain (points too the pages site)
No description
Xonestly
XonestlyOP2mo ago
and this is the www.domain
No description
David Wang
David Wang2mo ago
Does the domain without www work? It looks right to me.
Xonestly
XonestlyOP2mo ago
Without it works yes But with the w it doesn’t
David Wang
David Wang2mo ago
Might just be propagation then. How long has it been since you added it?
Xonestly
XonestlyOP2mo ago
1-2 days cloudflare is usually so fast about it so thats why i made this post
Xonestly
XonestlyOP2mo ago
but the website without the www works perfectly 🤷‍♀️
David Wang
David Wang2mo ago
I wonder if pages is bound by hostname
ryuwun
ryuwun2mo ago
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
ryuwun
ryuwun2mo ago
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).
Xonestly
XonestlyOP2mo ago
I tried to do it to pages but maybe I set that one up wrong Redirects I would assume to work tbh.
Want results from more Discord servers?
Add your server