Heroku App with Namecheap Domain Not Working - node.js

I have tried everything that has already been suggested on this site and others.
The Normal Way
Add my domain website.info to Heroku's "Domains and certificates".
Change the CNAME record to website.info.herokudns.com with the host www.
Leave the redirect record to be Host #, http://www.website.info.
Result:
"No Such App" comes up for Heroku.
The WWW way
The same thing as normal, except I added www.website.info to Heroku and removed website.info.
"This site can't be reached. www.website.info's server IP address could not be found."
Adding through the CLI
Installing heroku cli to my Git Bash: npm install -g heroku-cli
I try heroku domains:add website.info -a websiteapp.
"Domain already added to this app."
Tried accessing it. Same thing: "No Such App".
Removing the Redirect
Same thing as the normal way, just without the redirect.
"This website.info page can't be found" HTTP ERROR 404
I used to do this all the time when I was learning how to build web apps. Worked flawlessly. Did Heroku change something for free dynos? Do I need to run SSL or something?
At the very least, I can redirect the domain to the website.herokuapp.com domain, but I would rather not do that.

I've just had the same issue and tried all the methods you have tried plus more. In the end how got my custom domain to work was to set my namecheap Domain settings to Custom DNS.
elle.ns.cloudflare.com
rudy.ns.cloudflare.com
From there i used the www.customdomain.com format on heroku and set the rest up on Cloudflare as follows:
On the DNS Tab
Type Name Content TTL Proxy status
CNAME www myapp.herokuapp.com Auto Proxied
On the SSL/TLS Tab select Full
On the Page Rules Tab
If the URL matches:
customdomain.com/
Then the settings are:
Forwarding URL
301 - Permanent Redirect
/www.customdomain.com
After i applied those settings everything worked perfectly. I hope this can help anyone facing this issue in the future.

Related

Deploying a custom domain with Heroku and Domain.com

I'm new to web dev and this would be my first proper deployment so apologies if this is a basic question. After following the steps on Heroku and Domain.com, my app is not showing at the desired url: www.rocketcreative.agency
Heroku
I've set up a basic web app (a draft version atm) on Heroku, and the code is working fine on https://hidden-sierra-22116.herokuapp.com . I've followed the Heroku instructions to generate a DNS target (cubic-orange-7jtaz36102kt9f8dir53koko.herokudns.com) for a domain I own (www.rocketcreative.agency) Heroku Dashboard Screenshot
Domain.com
I added the DNS target to Domain.com as a CNAME (with 'www' as the host name). I've waited 24 hours for the changes to propagate, and DNS checking sites indicate that the DNS has propagated. I've spoken to Domain.com support and they said everything appears to be set up correctly. Domain.com DNS Screenshot
Terminal:
In the terminal, when I input host www.rocketcreative.agency, it returns www.rocketcreative.agency is an alias for encircled-horseradish-4mpqnlzar9say364tz3hgy80.herokudns.com.
Browser Results for www.rocketcreative.agency
Safari: 'Safari Can't Find The Server'
Chrome: 'www.rocketcreative.agency’s server IP address could not be found. DNS_PROBE_FINISHED_NXDOMAIN'
I imagine this is a really basic question but if anybody could help that would be great. If there's any other info I need to provide please let me know. :)
Hold the phone! I've solved this one, but I'll leave the question up incase anybody encounters the same. Ran the Heroku DNS Diagnostic tool and there were some issues with https:// - fixed by running: heroku domains -a hidden-sierra-22116 heroku ps:resize web=hobby heroku certs:auto:enable heroku certs:auto It said 'cert issued' and now the url works

React, Node.js, Express, Heroku, GoDaddy redirect problem

So I've built an online platform with React using Node.js and Express for the backend. Everything runs as it should on local and on my Heroku URL. Now I want to add a custom domain using GoDaddy, but it is just not working.
I've got my SSL certificate with Heroku and everything there seems to be correct. However, on the GoDaddy side, everything seems to be correct too. I've set my www CNAME in GoDaddy to my Heroku DNS URL. Also, I redirect my root domain to my www.domain and that seems to work fine too. But when I check my www.domain.com it says the location is domain.com which is not correct I guess.
The root domain is studoo.app
the studoo.app request location is set to https://www.studoo.app which is right because I've set that 301 redirect in GoDaddy
But when I go to www.studoo.app the location is set to studoo.app which I don't understand
when visiting www.studoo.app I get the "Your connection is not private" error.
If anyone could help me out, please reach out. I've been searching for a week now πŸ€¦πŸ»β€β™‚οΈ
Make sure you have both studoo.app and www.studoo.app as domains on heroku. On go daddy I would point both the root and www to the heroku URL

Heroku app not working with custom domain

I deployed a node app on heroku and pointed a custom domain to it from namecheap. When I type my domain in it will load a page that says "Theres nothing there, yet" and changes the url to domain.com.herokudns.com
After looking around for 2 days I came back to the same solution, I created two cname records on namecheap that pointed to the "domain.com.herokudns.com". The cname records automatically place a period after this target, when I place a period after my domain when searching, my website loads.
Is there a way to fix this? I've seen people with similar problems but I find it weird that my site will load both with www and without if I have a period at the end.
I had to change the cname record to a www name with the target of [herokuappname].herokuapp.com and add a url redirect # to http://[www.yourdomain.tld]. After clearing my cache this worked.

configuring heroku hobby dyno with a namecheap domain at root level

This question is highly similar to this, but barely different:
configuring namecheap domains with heroku
Here is what I have (for the purposes of hiding the original site, I have omitted its name for the string 'asdf'):
A namecheap domain titled as follows: asdf.com
A herokuapp running on a dyno that is hobby level that also has ACM set for automatic certificate management. It is running at https://asdf.herokuapp.com/ and this link works and gets my pushes from github integration. It is awesome :)
I want to link these up so that instead of having my site as https://asdf.herokuapp.com it would instead be https://asdf.com, so that is why I went and bought the namecheap domain for it, but linking these together I have failed at every opportunity. I have tried many different patterns but unfortunately I'm unknowledged on this layer of things. Here is something I have tried, but does not work:
On Heroku: Create a custom domain of: asdf.com
Heroku then supplies me with: asdf.com.herokudns.com
I then go into namecheap, and remove any and all possible cnames or redirects.
I create a new CNAME | host: www | target: asdf.com.herokudns.com
When trying to hit the site, I get this error:
ERR_NAME_NOT_RESOLVED
If I try changing CNAME host to # on namecheap, I get:
ERR_SSL_PROTOCOL_ERROR
Any help is greatly appreciated, and if more information is needed just ask.
Thank you.
I am experiencing the same issue. I've contacted Namecheap and Heroku both for support. This is what I've come up with, but my domain is still not resolving.
Since you're pointing www.mollydwellness.org at your app, you'll need to make sure you've added that to your Heroku config (currently you only have the non-www version assigned):
$ heroku domains:add www.mollydwellness.org --app mollydwellness
Once that is added, you should receive a new DNS target that you'll need to use to update your CNAME record.
$ heroku domains
=== mollydwellness Heroku Domain
mollydwellness.herokuapp.com
=== mollydwellness Custom Domains
Domain Name DNS Record Type DNS Target
────────────────────── ─────────────── ────────────────────────────────────
www.mollydwellness.org CNAME www.mollydwellness.org.herokudns.com
mollydwellness.org ALIAS or ANAME mollydwellness.org.herokudns.com
Namecheap Config
Type Host Value TTL
CNAME Record www
www.mollydwellness.org.herokudns.com.
5 min
URL Redirect Record
#
http://www.mollydwellness.org/
Unmasked
I am told to give it another 30 minutes before contacting support again. It's been 45 minutes and still not resolving.
Very confused, probably just going to deploy it myself to a VPS because that would be easier at this point. I went with Heroku to save myself time, but it appears there can be no shortcuts. More help from the community would be great.
the only thing you need to do for dns, is going to heroku, setting the following on the custom domain :
*.mywebsite.com
mywebsite.com
www.mywebsite.com
on Namecheap you do the following configuration:
CNAME Record # myapp.herokuapp.com. 1 min
CNAME Record www myapp.herokuapp.com. 1 min
URL Redirect Record # https://www.myapp.herokuapp.com Unmasked
URL Redirect Record www https://www.aipredictor.herokuapp.com Unmasked
and you are done. that covers all of the possible scenarios.

CNAME to a wildcard subdomain

Just trying to create an web application, clients can create their own instance of the app, so I created a wildcard subdomain in CPanel, checked VirtualHosts and the A record in the DNS, all fine.
Now when I go to "client1app.domain.tld" it works, takes me to the clients app, but when that client creates a cname "app.clientdomain.tld" to "client1app.domain.tld", I get redirected to cPanels "Default Web Site Page".
I double-checked everything.
App DNS:
*.domain.tld. 3600 IN A x.x.x.x
Customer DNS
app.clientdomain.tld. 3600 IN CNAME client1app.domain.tld
App VirtualHost:
ServerName _wildcard_.domain.tld
ServerAlias *.domain.tld
Any help is greatly appreciated.
Note: I do have root, this is a VPS.
Simple things first, have you added *.domain.tld as a subdomain in cPanel using the user interface and not the command line?
I have tried to replicate this problem using one of my WHM servers and could not.
I recommend first updating cPanel/WHM to the latest version as some support articles covering wildcard subdomains point to some old versions of cPanel have bugs with wildcard subs which are now fixed.
I would also rebuild the httpd.conf if you have at any point manually edited it. Also make sure that the subdomain is not the same as the hostname as this causes some internal binding errors.
I set my environment up using only the cPanel sudomain button and not using the DNS editors in WHM or cPanel

Resources