ruby-on-railsherokudnsdnsimple

Heroku Redirect from www to non www


I've just set up my custom domain on Heroku. I would like to redirect from www to non www.

The Domain Names I have set on Heroku are:

example.herokuapp.com
www.example.com
example.com

I'm using DNSimple. I have the following settings (in the form Type / Name / Content):

ALIAS / example.com / example.herokuapp.com
CNAME / www.example.com / example.herokuapp.com
TXT / example.com / ALIAS for example.herokuapp.com

I've tried using a URL type record but it doesn't work. How should I do the redirect? Thanks.


Solution

  • Remove the CNAME on www.example.com and use the DNSimple URL record to configure the redirect.