1

I'm hosting a Rails app on Heroku, using the Zerigo DNS. I've added both www.mydomain.com and http://mydomain.com.

My question is this: what is the best way to add a redirect so that http://mydomain.com redirects to www.mydomain.com? Would it be better to add the redirect on Zerigo? Or write some code in Rails to do the redirecting?

Any thoughts are much appreciated.

Alekx
  • 891
  • 1
  • 11
  • 19

2 Answers2

3

using DNS, just point your root domain to redirect to the www. subdomain.

http://www.zerigo.com/blog/2009/07/dns_updates_url_redirection_and_example_code_for_the_api

also

https://stackoverflow.com/a/12325021/1251349

Community
  • 1
  • 1
Andrew Wei
  • 2,020
  • 1
  • 17
  • 28
1

Add a CNAME record with www host and simply point it to your http://whateverapp.heroku.com

It works for me perfectly!

kiddorails
  • 12,961
  • 2
  • 32
  • 41