DNS CNAME www record, error code 522

I have a Cloudflare Pages project with a custom domain. Everything works fine if I try to access the site using the custom domain, but when I try to access the site using www.“domaim_name”, then I get the error code 522.
I have 2 records.
A CNAME record with the name @ and the content being “my_project”.pages.dev, for this Cloudflare uses the CNAME flattening automatically.
Another CNAME record with the name www and the content being @.

For now I have added a Page rule with forwards the url with the www and redirects to my custom domain.

Where you added the custom domain to the Pages project, you must also add the www name the same way so the server knows to answer to it.

Thank you, this worked.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.