I push my app I create with Ruby on rails on heroku and I have by default myapp.herokuapp.com
I buy my domain name on OVH I do heroku domains:add www.myapp.co to redirect to myapp.herokuapp.com.
I want to have only www.myapp.co this target and keep this went I am on the app. Could you guide to configure it on OVH.
I read this https://devcenter.heroku.com/articles/custom-domains and do what they say i don't understand check my url synestasia.co
Thank your for your help. really don't understand.
Steps needed to point (redirect) your OVH root domain (eg. yourdomain.com) to your heroku application.
Go to domain section in OVH and select your domain. Then click DNS ZONE
Remove entries (you can omit this step but OVH will tell you the same when you try to add an entry): Domain: www.yourdomain.com
with types of: CNAME yourdomain.com
, TXT 3|welcome
, TXT l|pl
(but this may depend on the
language as I'm using PL language).
Add CNAME record with www
subdomain and target to your heroku CNAME domain you have from heroku website eg. my-application-fcmnqo274218034.herokudns.com. Confirm clicking next
and confirm next step too.
Go to the Redirection tab and click Add a redirection
. Leave both fields blank (one with domain address where you need to fill subdomain and Also redirect www.yourdomain.com
checkbox unchecked. Click Next
.
In the next page you should see What type of target do you want to redirect yourdomain.com to?
question. Select to a web address and click Next
Next page says What type of redirection do you want to use to redirect yourdomain.com ?
. Select with a visible redirection.
and click Next
.
In the next window select Permanent (301) redirection and then you will be asked to provide your full address as in the placeholder eg. https://www.yourdomain.com
, then click next and validate the redirect rule.
Domain propagation might take a while (up to ~24h but mine was ready in few minutes). To not cache domain pointing to the DNS in your browser (as this might be fooling your with your website not found but it might work for others) you might want to use some tool to check if domain points to new servers (eg. https://dnschecker.org - that's not spam, I have nothing common with them)
Thanks to this user for posting that solution: http://community.ovh.com/t/redirection-vers-app-heroku/6392/16
To serve your domain name from Heroku, you need to tell the DNS service you use where your server is hosted.
Typically, this is done by declaring an A record DNS entry: A records expect a static IP address and so you just fill in your server's IP.
The challenge with Heroku is that it uses dynamic IP addresses, so A records are not an option.
So the other option is to declare a CNAME record: a CNAME points a name to another CNAME or an A record.
Problem is: CNAMEs are NOT supposed to be used for root domains (AKA base domain or apex domain.) They will only work with subdomains.
So you could easily declare www.example.com
to point to your Heroku app (on ANY DNS service, including OVH), but not example.com
.
To help with this problem, some DNS services came up with their own solutions that basically let you point a root domain to another domain.
The Add a custom root domain section of the Heroku docs mentions a bunch of these providers:
ALIAS at DNSimple
ANAME at DNS Made Easy
ANAME at easyDNS
ALIAS at PointDNS
CNAME at CloudFlare -- a bit of a misnomer
OVH offers no such option (maybe unsurprisingly given most of their business comes from hosting servers.)
Bottom-line: if your domain name is provided by OVH, either use a subdomain (e.g.: www.mysite.com) or change your NS records to use a different DNS service, one that supports CNAME-like functionality at the apex.
I'm no sysadmin. I spent a lot of time on this issue too and hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With