configuring heroku hobby dyno with a namecheap domain at root level - node.js

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.

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

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.

Heroku App with Namecheap Domain Not Working

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.

Heroku Naked SSL Custom Domain

I'm trying to find a current, up to date answer for setting up naked domain with Godaddy and Heroku SSL. My goal is for all pages to land on a secure page at https://www.example.com
https://www.example.com does go to a secure page.
example.com goes to an insecure page.
https://example.com does not work.
My current set up is as follows:
In heroku settings:
Domain Name | DNS Target
example.com | example.com.herokudns.com
www.example.com | www.my-domain.herokudns.com
Go Daddy Settings:
CNAME | www | www.example.com.herokudns.com
Forwarding settings:
Forward to: https:// | www.example.com
Yeah, it's a pretty stupid issue that some of the big DNS manager providers out there still have. The way to solve it is to have a server with an SSL certificate installed, and then point your naked domain to that static IP. The server then will redirect to the "www" version of your domain, which is now served under SSL by Heroku. Tedious.
If you don't want to do all that, just use https://www.nakedssl.com, which does exactly that – but automated (and for free for one domain).
Disclaimer: I'm part of the team that created NakedSSL, but I hope you take this as help and not as self-promotion. As explained above, the problem is as easy as tedious to solve, and I think NakedSSL is a pretty straight forward workaround.
Root domains on Heroku require the use of ALIAS ANAME or FLATTENING records.
Unfortunately, a number of popular DNS hosts such as GoDaddy, Bluehost, Google Domains, OVH, Hostinger and others do not support these types of records. Many of these Providers will tell you there is no such thing as ALIAS, ANAME or FLATTENING Records and many of these providers will tell you to set an A Record instead, however;
A Records do not work with Heroku for routing
A Records require static IP Addresses and static IP Addresses do not work with Heroku for routing, because Heroku (and many other cloud platforms) use dynamic IP's.
Instead, you can either:
Not use a naked domain and just use your www sub domain
Redirect/ Forward your HTTP root domain to your www sub domain. This won't work for your HTTPS root domain though
Use an Alternate DNS Provider. Heroku recommends the following: https://help.heroku.com/NH44MODG/my-root-domain-isn-t-working-what-s-wrong
Solved it.
Best way to get SSL set up is to use this package which automatically makes every page on your app SSL. Fantastic package. https://www.npmjs.com/package/force-ssl-heroku
Getting the naked domain set up with Godaddy easily: Set forwarding to your domain: https://www.my-domain.com. This will redirect non www to the correct place. :)
I believe naked subdomain or wildcards are not supported by heroku automated certs because of the let's encryption restrictions. So you need to set up a subdomain everytime you want to use Heroku's automatic certs.
ALSO VERY IMPORTANT! Don't forget to remove or edit any unsercured links to external assets. Otherwise browsers will jugde the page with those links unsecured as described in the Modzilla support page about mixed content.

How do I direct my openshift website to a gandi.net domain name I bought? I tried, but it's not working?

Okay so I created a web app and am hosting it on openshift. Right now, they just gave me a CNAME something like myapp-someappname.rhcloud.com. So they told me to use that CNAME to redirect to my domain.
Now on GANDI I bought a .com domain. Another thing is, I didn't realize there's much of a difference between www.website.com and just website.com, so the one I bought was just website.com. Now I have no idea how to redirect both of them to the www one.
For the CNAME I entered in gandi in expert mode www 10800 myapp-someappname.rhcloud.com. (with the dot at the end).
I woke up this morning, it's still not working. Also, when I go to www.website.com (Btw, website.com isn't my website, I'm just saying as an example) it just says app not found on server. When I go to just website.com, it actually takes me to gandi and says that the owner parked there or something.
So, what's the difference, and why does it say that?
How do I just SIMPLY get my website to work? I hosted it on openshift, have the CNAME, and at gandi I bought a .com domain with NO www in the front, so I don't know much about that. How do I just simply get this to work? I am so frustrated.
Here's a similar question regarding Heroku instead of Openshift, but you might easily be lost in the detailed configuration.
To simplify things, I'd recommend using Cloudflare, a Content Delivery Network, which is what I use.
Follow these steps to set it up: How to Use a CDN with Your OpenShift Application

Resources