'Heroku Custom Domain Not Working

What is the correct way to connect a Heroku app with a custom domain?

This is how I did it in the past:

  1. Point Godaddy's DNS to heroku's provided target (example: https://peaceful-escarpment-22825.herokuapp.com)

  2. Turn on domain forwarding on the domain

  3. Add domain to Heroku in the settings

For some reason now my provided target from Heroku is like this: mycustomdomain.com.herokudns.com. When I add that DNS to GoDaddy I get a There's nothing here, yet. page.

Where am I going wrong? Thanks!



Solution 1:[1]

This worked for me, but I had to include --app <app name> at end of the command. Like this:

heroku domains:add www.yourwebsite.com --app <app name>

For the app name, it is the app name you used when creating the app in Heroku.

Solution 2:[2]

FIXED!! After struggling for a long time setting up my www domain with my Heroku app, I had to point the domain to Cloudflare then set it up as follows:

[1]: https://i.stack.imgur.com/o6CJc.png . [2]: https://i.stack.imgur.com/P8PSQ.png . [3]: https://i.stack.imgur.com/BB0DI.png .

Then everything just works perfectly both NON-WWW and WWW domains.

I did not need to do any URL forwarding as see bellow

[4]: https://i.stack.imgur.com/wgMit.png .

Solution 3:[3]

Heroku domains:add www.yourwebsite.com --app <app name> 

This is the best way to do it as it needs to know which specific app to point to.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Worthwelle
Solution 2
Solution 3 BitcoinKing