1

I'm on heroku and I'm trying to get http://domain.com/* to redirect to http://www.domain.com/*. Using rack-rewrite, I got http://myapp.herokuapp.com/* to successfully redirect to http://www.domain.com/*. I can't however get http://domain.com/* to redirect to http://www.domain.com/*.

Looking at a similar thread, it seems I'm supposed to set my A record to point to myapp.herokuapp.com. I could set my CNAME (www) to myapp.herokuapp.com, but when I tried to do so with my A record I got this error:

INVALID_IP: 'myapp.herokuapp.com' is not valid IP for A record. (host name: @)

I've tried it with myapp.herokuapp.com. as well but I get the same error. What am I doing wrong? I've also tried setting @ to other record types but none gives me the http://domain.com/* I'm looking for. Any help would be greatly appreciated.

EDIT: Ok so setting @ to a CNAME completely fixed the problem. I'm not sure why everything I've read referenced A record though.

Community
  • 1
  • 1
user1650177
  • 445
  • 3
  • 10
  • Yeah a CNAME is essentially another domain or subdomain to connect through, an A record is an IP Address. – agmcleod Sep 07 '12 at 13:39
  • Note that there are some downsides to doing that. In particular, availability. See https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords – Jon Mountjoy Sep 07 '12 at 13:57

0 Answers0