Domain name not routing with Heroku and Namecheap - heroku

I recently purchased a domain name with namecheap.com, and added a CNAME record from my Heroku app where I am running the application. I am sure that I added the correct domain name to my Heroku app, and the correct DNS target to my CNAME on Namecheap web settings.
Previously it was working, but this morning I purchased an SSL certificate on Namecheap, and my domain just points to a Namecheap page saying "This domain is registered with Namecheap".
I followed all the steps to properly activate the SSL certificate, and it even says it's activated on Namecheap on the domain I want. Also what's strange is the the Heroku domains appear to have good ACM status.
So on the surface everything seems to be all right, but when you go to my domain my app doesn't show up.
Any idea as to why this is? Also if you have any more information you want to know feel free to ask.

I figured it out. I had to delete the default records on the domain. Initially namecheap sets a reroute, and CNAME for their parking lot page.
These need to be removed so that they don't interfere with the domain routing that you want.

Related

How to associate Heroku app with a Google domain?

I purchased a domain with Google and I would like to associate it with a Heroku app. What is the step-by-step process to achieve that?
I recently connected my app to a custom domain. Although my domain is purchased from AWS route53. I think the approach generally is the same.
First of all, you can check out this page written by Heroku. https://devcenter.heroku.com/articles/custom-domains
I believe the tutorial given by Heroku works. However, I am tired of all those CLI that make things unvisable XD. Luckily, we can configure it from the Heroku website instead of the CLI.
Here is my approach:
First open your app in the Heroku web page, then click the "Settings" button
https://dashboard.heroku.com/apps/{your app name}
Scroll down until you see the "Domains" section, Then click "Add domain"
https://dashboard.heroku.com/apps/{your app name}/settings
Input the domain name you purchased from google (eg. www.example.com)
After adding your domain, Heroku will give you the DNS target.
From your google domain DNS management page, you should be able to add a new record for your hosted zone.
Finally, add a new record with simple routing policy, type CNAME, and value equals to the DNS target provided by Heroku.
It is really simple if you follow these steps correctly. Due to my reputation level, I cannot upload photos. Feel free to contact me if you want some image to guide you how to locate the buttons :)
It’s only 3 steps:
1. Heroku, in your app > Settings > Add your domain:
Add www.[foo.com] (Note: www is KEY!) to your app
Copy the [DNS Target] it gives you
2.Google Domains > DNS > Resource records > Custom Records > Manage Custom Records:
www, CNAME, [DNS Target]
Now you’re basically set up. If someone goes to https://www.[foo.com] in a few minutes, they’ll see your Heroku app hosted at [DNS Target]. But if they go to any other permutation (http, non-www) they’ll get a 404 error. To solve this, we’ll set up permanent redirects to the main version in the next step.
Google Domains > Website > Add a Forwarding Address:
From Field: [foo.com]
To Field: https://www.[foo.com]
Permanent Redirect (301)
Forward Path (so that [foo.com]/about forwards to https://www.[foo.com]/about)
SSL Enabled
Boom. Wait a couple of minutes for DNS to catch up, and you’re done.
heroku certs:auto:refresh
In Terminal refresh the SSL cert settings on Heroku, and check the Heroku Dashboard to confirm everything’s working.
Confirm all the below permutations forward to your site correctly:
https:
https://www.[foo.com]
https://[foo.com]
http:
http://www.[foo.com]
http://[foo.com]
paths:
https://www.[foo.com]/about
http://[foo.com]/about
PS: So does this work for the naked domain like [foo.com] instead of www.[foo.com]? No! Google Domains does not support ALIAS domains, and therefore in combination with Heroku does not support forwarding to the naked (aka. root aka. apex) domain. Sorry! This surprised me too :( Source 1: Heroku Docs | Source 2: StackOverflow. Your only alternative here is to transfer your domain (which costs money) to something like Cloudflare.
A working answer with these explanations is taken from https://nikodunk.com/heroku-ssl-google-domains-2019/
Just to add to Fergus's answer, if you are seeing the warning "cant add cname records as root domain" add www to the host name input.

Heroku app custom domain points to empty root

I've set up my app on Heroku. Everything loads fine when I access the herokuapp.com domain.
I've added my own domain to the app and added the CNAME as instructed but when I go to the subdomain it's just showing an empty root.
I'm not sure what I am doing wrong here!
I've checked the domain is added to the app running heroku domains in terminal and it's there.
This is the first time I've published an app on Heroku but I've followed the instructions and I can't see what the problem is.
Any help is much appreciated.
Thanks
I managed to resolve this issue by adding another CNAME record in the domain provider account and creating the subdomain in there, rather than from the server.

Deployed heroku app not showing up on custom domain

I set up a custom domain for my heroku app, which worked ("Theres nothing here, yet").
I then deployed my first version of the app to heroku and tried to access it via the custom domain, but still got the message "Theres nothing here, yet".
The deployment was successful and the app can be reached via appname.herokuapp.com.
How do I get it to show up on my custom domain?
I had the same issue this morning but managed to resolve it.
I added my custom domain via the settings menu of the heroku dashboard (web page) and then added the heroku DNS target to a CNAME record with my DNS provider (GoDaddy). After just a few minutes the DNS target URL was pointing to the purple "There's nothing here, yet" page. 10 or 15 minutes later my custom domain name was also pointing there, but no sign of my app.
Researching the issue led me to your post and also to https://support.dnsimple.com/articles/heroku-error-nosuchapp/
Following the instructions at the bottom of the page I used the heroku command line to add a 'www' version of my custom domain.
heroku domains:add www.example.com
Immediately after this my app showed up at my custom domain. I didn't even need to add the 2nd DNS target to my DNS provider. It just worked.
Curiously, pointing my browser directly at the DNS target URLs does not work.

Custom Domain With Heroku with a CNAME record - not working

I used the heroku guide to setting up a custom domain to set up a custom domain for a Heroku app, however, the custom CNAME record I set up at Dreamhost isn't working correctly. The website for my app (myappname.com) shows the Heroku page that says "There's nothing here, yet".
Here's what I used per the Heroku guide:
CNAME record at Dreamhost:
record: www
type: CNAME
Value: myappname.com.herokudns.com
In my Heroku settings this is what shows as the target DNS:
myappname.com.herokudns.com
This is my first time setting up a custom domain with Heroku so I'm not sure whats going wrong. I looked at all of the similar questions here and read some guides online too. Should I change the DNS record to "myappname.heroku.com"?
I should note the heroku app is on the free tier so there is no SSL.
For future reference, if anyone else makes the same silly mistake I made, make sure your DNS target at Heroku includes the correct subdomain ('www' in this case).

Media Temple and Heroku CNAME

I am using Media Temple to configure my DNS settings for a domain. I recently launched an application on Heroku and want to set a subdomain of my domain to be the CNAME for the Heroku application. The issue is the DNS editor places a period at the end of the Heroku domain name when I enter it as a CNAME, and Heroku shows an error that this is not a valid domain.
In my DNS settings, I have:
subdomain.domain.com CNAME appname.herokuapp.com
When I save this, it shows up in the settings as
subdomain.domain.com CNAME appname.herokuapp.com.
Any ideas on how to remove that trailing dot?
I ran into this problem the other day when setting up CloudFlare for my Heroku app. "I do not think it means what you think it means."
With Heroku, you have to add domains that your app will be accessible from, even if your managing DNS elsewhere. Here's there documentation for how to do it. Basically, you can do this from the terminal:
cd into your app's directory
heroku domains:add subdomain.domain.com to add the subdomain like you want.
Also, on mediatemple, I think you might need to put just the subdomain part instead of subdomain.domain.com, though it'll probably work either way. As shown on the knowledgebase article from launchrock on adding a CNAME with Media Temple:
"5. In the Name field, enter the part of the address you chose to use for your website with
LaunchRock. For example, if you chose signup.yoursite.com, enter signup in the Name field."

Resources