Cannot access website with WWW

I bought a domain name at GoDaddy.

I changed the nameservers to point to Cloudflare.

All works fine when I use the root name. When I try to access the website with “WWW” it doesn’t work and redirects me back to GoDaddy.

https://hiddenbedhostel.com/works
https://www.hiddenbedhostel.com/does not work

Looks like the www CNAME is not working for some reason.

My DNS configuration is following:

Any help will be appreciated

It could just be that the server isn’t configured for ‘www’. But if the root name works, and it seems it’s your canonical URL, I suggest a Page Rule:
Match: www.hiddenbedhostel.com/* and a setting for Forwarding URL (301) to https://hiddenbedhostel.com/$1

The $1 will forward the path from the ‘www’ request. Or you can leave the $1 off and ‘www’ will always redirect to the homepage.

I did what you suggested. At the moment it doesn’t work, maybe it needs time to propagate.

Just curious, when you say “the server isn’t configured for www”, which server are you referring to? I host the website as SPA on Cloudflare, I don’t have a server for fallback. Also, shouldn’t www CNAME work by default on Clouflare without the need for Page Rule?

Btw, the page rule looks like this, as per your suggestion:

The redirect is working:

Yes!

Thank you for helping.

1 Like

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