Custom Domain pointing to heroku app changes URL in browser? - heroku

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

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.

How to redirect my naked domain to https://www.mywebsite.com with Google Domains and Heroku?

I host my website on heroku and my domain is managed by google domains.
I have successfully linked my domain to my heroku app. However, to go to my website, people are forced to type the exact domain www.mywebsite.com . If someone just type mywebsite.com there is an http error.
I'm searching on both google & heroku docs but i don't find anything related to this . All info i found are about subdomains.
Any idea for redirecting all http/www typo to my www.mywebsite.com ?
At the core, keep in mind that example.com and www.example.com are 2 different hosts that can resolve to different IPs. Your DNS settings at Google Domains handles this. Either direct both of them to Heroku or simply direct "www" to Heroku via the CNAME record that they give you and then use Google Domains forwarding feature to forward all non-www traffic to www.example.com.
In the Synthetic records, choose Subdomain forward, fill # in Subdomain, then www.yourdomain.com in the Destination URL, also choose Forward path and then ADD

adding custom domain in heroku with big rock domain

I have a heroku app which i want to point to www.infoxpression.in
I added the domain name on heroku and added CNAME record in my bigrock DNS management but it is not working...
Big rock DNS management records:
Heroku dashboard:
Am i doing it wrong?
To connect your heroku hosting to big rock domain,
You have to open your big rock domain account and in the DNS Management page add in the cname the host: www and in the point to: your heroku url And in the heroku page in the settings add three domains:
1 *.xyz.com
2: xyz.com
3. www.xyz.com
This is to point your domain name from heroku side
heroku domains:add example.com
heroku domains:add www.example.com
heroku domains:add *.example.com
This should work :) Check this video https://www.youtube.com/watch?v=kKGSGT7mSnQ&feature=youtu.be
Please make sure that your bigrock account has default nameservers
like in the image:
Domain registration >> Name Servers
Do the domain forwarding as well.
Domain forwarding >> Manage domain forwarding >> add new
sub-domain prefix = (leave it blank if you have no subdomain)
destination URL = http://www.yourdoamin.com
URL masking is off
However, it will take 24-48 hours for updating.

Prevent heroku to redirect from http to https on subdomain

I have an app created on Heroku and I added subdomain to it:
some.page.example.com
www.some.page.example.com
Then, according to this, I've pointed these names to proper Heroku names with my DNS provider like this:
some.page.example.com CNAME some.page.example.com.herokudns.com
www.some.page.example.com CNAME www.some.page.example.com.herokudns.com
I'd like to serve this page under http, apparently Heroku internally redirects traffic to https - it returns 301 when trying to access page via http. Of course finally it fails (e.g. ERR_SSL_PROTOCOL_ERROR in Chrome or SSL_ERROR_INTERNAL_ERROR_ALERT in Firefox), after redirecting, beacuse there is no certificate set up on this Heroku app.
How can I prevent Heroku from doing this?
P.S. What's funny, I have other site on Heroku, with root domain pointing to this, and it works like a charm. :/

Resources