Www subdomain re-route returning connection timeout

First of all I would like to mentioned that i’m new to Cloudflare and hosting stuff in general, so please do correct me if i’m wrong.

Currently i have a page deployed on Cloudflare under <domain_name>.pages.dev, and i have setup a custom url for my page with the domain name being <domain_name>.com. I have no issue when i access the page using <domain_name>.com, but I am having issue accessing the page if the url is www.<domain_name>.com.

As far as i know (i could be wrong though), setting up CNAME with “www” as name and “<domain_name>.com” as content should route “www.<domain_name>.com” to “<domain_name>.com”, which would be route back to “<domain_name>.pages.dev” since i have another CNAME with “<domain_name>.com” as name and “<domain_name>.pages.dev” as content.

My problem right now is that I am getting connection time out (error 522) when im trying to access www.<domain_name>.com. What did I did wrong?

The www subdomain (for example.com) needs to point to <site>.pages.dev not example.com as mentioned in this documentation.

You cannot just add a CNAME from www.domain.com to domain.com if the webserver only knows domain.com. You would have to create a redirect rule to redirect traffic from www.domain.com to domain.com or ad www.domain.com to the webservers configuration.

is @anon9246926 correct in his understanding that you are using Cloudflare pages? Then do what he recommended. If you are only using Cloudflare as DNS, the redirect should work.

1 Like

@anon9246926 i have tried that but it is still returning the same errors. Does DNS setting such as CNAME takes time to propagate by any chances? Some online forums says it does takes up to 48 hours to fully propagate and some says it doesn’t.

@Laudian Yes, he is understanding correctly that I am using Cloudflare pages.

Is www.myhappydumpling.com added as a custom domain on the pages project?

1 Like

currently I add [Preformatted text](http://myhappydumpling.com) without the www as my custom domain. I assume that I should add only the root domain and configure my DNS setting if I wanted to have a subdomain (in this case it’s www), am I wrong?

You are wrong.

You need to add www.myhappydumpling.com as a custom domain as well. Cloudflare will automatically configure the appropriate DNS record (if it is missing) when you add it.

1 Like

This is the solution I am looking for!!!
Thank you so much @anon9246926, and @Laudian too

1 Like

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