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.