I have a domain, sub.example.com, that points to a herokuapp.com app via a CNAME record (domain from http://www.name.com). When entering the domain in a browser, the app loads just fine, but when I try to pass it through the HTML validator at w3c.org, I get an error:
500 Can’t connect to sub.example.com:80 (Bad hostname ‘sub.example.com’)
In my app I have an “og:image” meta tag for showing an image when linking on Facebook. When using ‘http://sub.example.com’ in Facebook, the “og:image” does not show up (actually none of my open graph tags seem to work).’
However, when I use the blah-1234.herokuapp.com domain in either the w3c.org validator or Facebook, everything works. The validator runs, my image shows up, etc. In the console, when I enter “heroku domains” it returns “sub.example.com.” I’m really at a loss here as to what is causing these errors. Is there some setting I may have overlooked on Heroku or Name.com?
extra:
- my CNAME record has a TTL of 300
- “curl sub.example.com” returns my app’s rendered root page
- edit: My root domain has an A record
It appears that this problem was caused entirely by the way I entered the herokuapp address into Name.com’s DNS record manager. I entered it in as
http://blah-1234.herokuapp.comwhen it should have beenblah-1234.herokuapp.com.It was the “http://” at the beginning that was causing all of the problems. Egg on face.