Godaddy and heroku, pointing domain - heroku

I have a domain from godaddy and an app hosted on heroku. Now I can access my app by domain.com or www.domain.com or domain.herokuapp.com i want to remove the last version and domain.herokuapp.com to become domain.com.
I have name.com and www.name.com worked but i want to get rid off name.herokuapp.com
Thanks!

You can use rack-cannonical-host https://github.com/tylerhunt/rack-canonical-host to force anyone visiting domain.herokuapp.com to be redirected to domain.com or www.domain.com. I use this for CodeTriage so if you visit http://issuetriage.com it will redirect to https://www.codetriage.com. Here is the code in the project that sets up the redirect.

This may helps (Custom Domain Names for Apps in Heroku).
You can also redirect www.domain.com to domain.com in GoDaddy

Related

Custom domain(Hostiner) in heroku not working without www

Recently i have purchase domain from hostinger and using heroku hosting but some how my domain working only with www. when i try to access url like example.com it shows me hostinger page.
i have tried follwoing name as domain name in heroku custom domain setting.
www.example.com
example.com
*.example.com
and tried using dns target of above url in my hostinger domain setting in CANME but its still not working.
what should i put in hosts part of hostinger and where its should be exactly pointed to.
Please help me to solve the error...

masking heroku app from godaddy using cloudflare

I am trying to set up my herokupapp with my custom domain name from Godaddy. I hav gone through the process of getting it wokring using a cname through cloudflare.
Everything is working. However, when I go to my site at example.com my browser changes the url to example.herokuapp.com.
Going to: http://www.example.com/ and www.example.com do work
I don't want this obviously, what am I doing wrong?
Don't use an A record for your root domain. Heroku doesn't provide static IP addresses, so whatever value you put there won't be valid for long.
Since you're using CloudFlare you should be able to set up a CNAME for your apex domain just like you did for your www subdomain. CloudFlare has a feature called CNAME flattening that should make a CNAME on your root domain work as expected.
Regarding your comment that the www subdomain started working, that's typical of DNS changes. They take time to propagate. Give it some time.

use both www and naked domain to point my heroku app

I am having trouble to set both my www.domain.org and domain.org to point to Heroku rails app.
I did a CNAME from www to www.example.org.herokudns.com.
it works fine and my www.example.org point to my example.herokuapp.com
Concerning https://example.org
Should I do a
CNAME from # to example.herokudns.com ?
ALIAS is only accepted for IPs with my domain provider..
I having trouble finding an answer in stackoverflow.
Should I use http://wwwizer.com/naked-domain-redirect ?
Do I have a solution without using a third party free service ?
For naked domain example.com you can use the forwarding functionality. If you have purchased domain from GoDaddy you can follow this:
Go to manage DNS and scroll down to forwarding section where you will see something like this:
You can choose https and forward to www.example.com. (You can also make your naked domain point to some other subdomain)
heroku domains:add example.com
heroku domains:add www.example.com
heroku domains:add *.example.com
This is to point your domain name from heroku side
Here is a youtube video to make it easier https://www.youtube.com/watch?v=kKGSGT7mSnQ&t=29s
Please let me know if this does work

Custom Domain pointing to heroku app changes URL in browser?

I have an website hosted on heroku. App url is like example.herokuapp.com
I bought domain with name www.example.com and on visiting this URL I pointed to example.herokuapp.com. This works fine however URL in browser changes to heroku app rather it should stay custom domain www.example.com
What configurations are required?
That suggests you're using domain forwarding at your DNS provider and not adding a CNAME entry to your domain pointing at example.herokuapp.com for the www host

Domain.com/path redirects to www.domain.com using heroku

My Host records are:
# http://www.domain.io URL Redirect
www app_name.herokuapp.com. CNAME (Alias)
I'm sharing domain.io/path and it's redirecting to www.domain.io rather than reaching the path
www.domain.io/path it's successful
Namecheap suggests that it is an issue on the heroku side
Thanks for the help

Resources