Erin Walker
Erin Walker

Reputation: 739

Pointoing my Heroku Rails app to www and without www works only for an hour?

My Rails app works with Heroku and if I set my CNAME at my domain register Afrihost to www.domain and without the www it works fine for an hour. Then it kills the app without the www domain infront and I have to log in and change the dns again.

Afrihosts states, because of a certain law it can't point a cname to both with a www and without a www in-front. Is that true for all domain registers?

What alternatives are there as I want to point to both with and without the www in-front.

Thanks in advance.

Erin

Upvotes: 7

Views: 9107

Answers (3)

Blaine Hatab
Blaine Hatab

Reputation: 1676

I liked the fix I went with. I just added a url redirect from mywebsite.com to www.mywebsite.com. So on type you just choose 'Redirect' and leave the host part blank. Then type in the url of your website 'http://www.mywebsite.com/' in the 'Data' section. Worked for me.

Upvotes: 8

Erin Walker
Erin Walker

Reputation: 739

I found the answer https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords

I must use an A-Record.

Thanks

Upvotes: 1

Neil Middleton
Neil Middleton

Reputation: 22238

CNAMES cannot be used on naked domains (e.g. yourapp.com), only subdomains (e.g www.yourapp.com).

For the naked domains, you need an A record, or something like DNSimple's ALIAS.

Upvotes: 5

Related Questions