Root domain produces errors or redirects to random websites

I set the DNS records according to the guide on Heroku, where the website is hosted. So the www domain is added as CNAME record. Based on what I’ve read all the requests to root domain should be processed automatically thanks to CNAME flattening, but it doesn’t happen.

I see several A records added automatically for the root domain and pointing to different IP addresses, but accessing the website by root domain produces all kinds of errors. Among them are 403, 404, 522 etc, depending on the browser and time of visit. Or more importantly, the root domain redirects to absolutely different websites, like, etc. This happens randomly and doesn’t follow any logic.

How can I fix this? I’d be glad to provide additional details if needed. Thanks!

What’s the domain?

Generally, if you’re using a CNAME setup, your site needs to use ‘www’. And let a Page Rule redirect requests to that hostname.

Thanks @sdayman. The domain is I thought the CNAME flattening feature allows using both root and www domain without additional page rules. But it works for some requests and doesn’t work for others. I’m not a huge pro when it comes to DNS records, I’m just referring to the guide Thanks for the link, I’ll look into this.

CNAME at root isn’t compatible with many hosts, so they generally ignore it. Which is why I recommend the www redirect. Your www site works, so the Page Rule I linked to should get your site working.

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