Setting up a domain for your heroku app

I’ll admit, I’m not an expert in network administration so I had a bit of difficulty getting my domain connected to heroku on my own. After about 10 minutes i ended up with an infinite redirect error.

My domain is registerd over at Hover so I was able to just contact their customer support and have them walk me through it. Here are the key changes i needed to make:

hover.com Settings

First, you need to forward the domain. Make sure you include the www if you dont want the extra headache.

Click on the DNS tab and add a CNAME record with your heroku domain: example.herokuapp.com  You can find this on your heroku dashboard.

When you take care of all of that you should be good to go, unless..

Extra: Ghost config

This had me stumped for way too long, but there are 2 gotchas after you set this up with a ghost blog

  1. Make sure you set your global enviroment variable HEROKU_URL to your full www domain. You can find the Config Variables section on the settings page of your dashboard.
  2. Clear your cache! Chrome seemed to cache the redirects long after I made the change..

*Thanks to Michael Fulton for the tip: http://stackoverflow.com/a/35993692

Published 14 Oct 2016

Ventures in Frontend Web Development
Simon W. Jackson on Twitter