I have a CNAME for www.mywebsite.com pointing towards example.herokuapp.com, and the original Heroku page is working just fine. However the CNAMEd website (www.mywebsite.com) is showing a Herokuapp 404. Why is this so? Why can't I point my CNAME towards the Heroku page properly?
-
Duplicate of stackoverflow.com/questions/16298/… maybe?– Alexis WilkeCommented Nov 28, 2016 at 1:22
-
Also in case you were trying with HTTPS, but I would imagine you would get an error other than 404. stackoverflow.com/questions/9294215/…– Alexis WilkeCommented Nov 28, 2016 at 1:24
-
Can you share more details on how you are using your CNAME? It is possible that the web server is not understanding the domain name in the request header and serving the request from another site. This is fairly common and could give a 404 for a request that does not exist though usually this at the file name level - for example, index.html. Confused? Don't be. It is likely the 404 is a result of the web server not knowing what you are talking about as a result of a bad CNAME. Having more details may help us help you. Cheers!!– closetnocCommented Nov 28, 2016 at 5:36
-
@closetnoc Well, just to start off the info I'm using Cloudflare for DNS, the CNAME is a CDN with an automatic TTL, and it's name is www.– skistaddyCommented Nov 28, 2016 at 13:21
-
go to your heroku app settings and add a custom domain– tomCommented Aug 2, 2019 at 1:15
Add a comment
|
1 Answer
You can't just set a CNAME and hope for the best when it comes to Heroku. You actually need to log into the Heroku admin panel and configure the CNAME record that you are creating so that Heroku knows what CNAME'ed domain maps to what app on the server.