Nepal on Rails

millisami's rants!

Octopress Heroku Custom Domain to Redirect to Non-www

Recently I’ve moved to Octopress with Heroku free hosting. Here I am not going to on how to migrate or create a new Octopress powered blog. Instead polish the final DNS part.

Objective: Visiting to or, should do 301 permanent redirect to or, carrying along the PATH_INFO as well.

After all the work done, open up the Heroku’s app dashboard and add the custom domain.

heroku custom domain

For this blog, I’ve only added the root domain

Then on your DNS provider, we have to add the CNAME records. Here I use NameCheap. In the manage domain page of NameCheap, click the All Hosts link in the left sidebar and add those values:

namecheap domain manage