I created a Cloudflare page sanket-sapate-github-io.pages.dev and connected it to sanketsapate.live
Both the links are working fine.
Now I want to add CName record www which redirects to any of two links.
After adding the record, visiting <www.sanketsapate.live> says Connection Timed out Error 522 even though both the previous url are working fine.
1 Created a cloudflare page named <sanket-sapate-github-io.pages.dev>.
2 Connect the page to custom domain <sanketsapate.live>
3 Created a CName record name=www target=@
www.sanketsapate.live is not working.
Error code 522, Connection timed out
Adding custom domain not enough, you need to do it a little bit different way, how described in that article: https://developers.cloudflare.com/pages/configuration/custom-domains/#add-a-custom-domain
In a nutshell: you need to setup a Custom domain via Pages "Custom domains" configuration.
How documentation says: