I am aware that there have been a few discussions on this one but none have given a definitive answer. I am hoping this will help me and others.
Problem:
I have a domain name (www.xyz.com) registered with 1&1.
I want users to be able to type this in and be shown my website. A Heroku web app.
I want the domain name (www.xyz.com) to be displayed. Not any subdomain url or the heroku app URL.
I do not want the set-up do be anything that will have a detrimental impact on SEO.
Note:
I have just got off the phone with 1&1 and they have said that my only options are to do a frame redirect or a http forward. Neither of these meet the above requirements.
Additionally, other posts have suggested finding out what the Heroku IP address is and using this but Heroku recommend against this as they might change it without notice.
Please could I ask that any one kind enough to respond spells things out a little. Anyone having problems with redirects is likely to be new to this.
Thanks.
5
Answers
never used the 1&1 services, but solving your problem is pretty straightforward.
Take the following steps:
heroku domains:add www.xyz.com
. If you have more than 1 app in your heroku account, remember to pass the--app
flagmyherokuapp.herokuapp.com
where myherokuapp is the name of your app on herokuCNAME
record pointing tomyherokuapp.herokuapp.com
I’ve never used 1&1 but my DNS provider (dreamhost) does not allow CNAMEs on the main domain name either. It does however allow me to create a CNAME for the www subdomain which was good enough in my case.
I did this:
It’s not exactly what I wanted (or what you want) but it works.
What worked for me was to user
Namecheap.com
‘sFreeDNS
service that provides free automatic redirect for your TLD and subdomains directly to Heroku, while keeping your domain visible:example.com
andwww.example.com
now point toexampleapp.herokuapp.com
I had to have a live chat with Namecheap’s support to complete the domain verification process, but they answered really fast! Love to namecheap, 1and1 is really crappy, moving my domains away soon. 🙂
I found this video to be helpful – https://www.youtube.com/watch?v=ZLVBBAnrrL4
Basically, as noted by @Kevin Lawrence above, you use the ‘www’ subdomain.
I got this to work properly! No need for CNAME at all. Create a A record in heroku like in this link – creating a custom room domain – provided by heroku (of course, change example.com to your root domain):
Here, example.com is the ROOT domain. Once you get an A record, execute the following command
Now verify your domain has been provisioned:
And you get this:
Next, get the IPv4 IP address of
elliptical-blueberry-1euo3460fyrtc8zdgulv0f7o.herokudns.com
I got it by using a lookup service.Updating 1 and 1