TLDR: root and subdomain seems to work, but
curl -I command doesn’t for the subdomain.
I have a Rails app hosted on Heroku and just set up Heroku custom domains for both a subdomain (www.example.com) and root domain (example.com). Both statuses are up and running and look okay. My domain registrar is Google Domains, however they don’t have root custom domain support so I now use Cloudflare for DNS.
I created two CNAME records for both the subdomain and root domain and when I try to access the site via different combinations on the web (e.g. check http to https redirection), it looks like it works just fine.
When I try to run
curl -I example.com for the root domain, it works.
Now when I try to run
curl -I www.example.com for the subdomain, it does not work.
Why is this the case?
Thanks for your help.