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

3

7

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

Batman answered 31/7, 2012 at 10:40 Comment(0)
D
5

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.

Dior answered 31/7, 2012 at 10:48 Comment(1)
Ok I understand. But how can I set up my heroku app then, because to work they want it to point to CNAME.Batman
S
8

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.

Sibeal answered 11/3, 2013 at 20:17 Comment(1)
how to add url redirect , is it in the code or in anything we can add?Tague
D
5

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.

Dior answered 31/7, 2012 at 10:48 Comment(1)
Ok I understand. But how can I set up my heroku app then, because to work they want it to point to CNAME.Batman
B
1

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

I must use an A-Record.

Thanks

Batman answered 31/7, 2012 at 12:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.