Why does a custom domain redirect to herokuapp.com?

In my case using Ghost, updating the HEROKU_URL in the Ghost configuration to 'http://www.myapp.com' fixed this error. I thought I had this set up, but I changed it to 'http://myapp.herokuapp.com' so I could access the admin panel, which wasn't accepting requests from URLs not HEROKU_URL.

I was also having a separate issue with Chrome automatically, helpfully-not-helpfully redirecting before the request hit the server, so the Node app received a request for myapp.herokuapp.com. I discovered this by trying to use another browser to access my app. I cleared the browser cookies and cache and myapp.com was no longer redirected in Chrome.

Tags:

Heroku

Ghost