Can't properly forward GoDaddy domain to Heroku server via HTTPS - http

I have a problem with configuring Godaddy DNS and Heroku hosting server.
The goal is: when I type www.example.com or example.com as URL, it needs to go https://www.example.com.
Right now when I go www.example.com or example.com, it goes http://www.example.com
Configurations are:
On Heroku
heroku domains:add www.example.com (SSL is working. Cert issued)
On GoDaddy
DNS record: type=CNAME name=www value=www.example.com.herokudns.com
DNS forwarding domain: forwardto=https://www.example.com forwardtype=Permanent(301) settings=Forwardonly
DNS forwarding subdomain: subdomain=example.com forwardto=https://www.example.com forwardtype=Permanent(301) settings=Forwardonly
P.S. If I manually go https://www.example.com the browser shows that it is secured
Edit: Update my nameservers and DNS settings to support this change is checked

Under GoDaddy doamin forwarding, make sure to check the box next to "Update my nameservers and DNS settings to support this change", then save.
If that is done. Confirm that your local dns cache has updated. Run these two commands, if the IP addresses returned are different, you may need to clear your cache or make sure that you haven't made manual changes to your host file.
nslookup example.com 8.8.8.8
ping example.com

Are you using Apache? If so, the .htaccess file is the best way to change the default domain.

Related

Http on apache to https on nginx

How do I redirect my http://example.com website on apache to https://www.example.com website on nginx.
Thanks
Firstly you must add A record (in DNS config) for www.example.com transfer for nginx website. But it not OK for clients and SEO overall. And the second A record must be for example.com on apache website.
After or before adding of DNS record you must check Apache config for example.com - apache website must work for example.com only.

DNS for Meteor Galaxy

Can someone explain to me how I need to configure my DNS settings using Galaxy and HTTPS? I obviously have no problem doing this on a provider with a static IP, but on Galaxy i just can't get it to work using DNSimple.
I want the following setup:
http://example.com -> https://www.example.com
https://example.com -> https://www.example.com
http:/www.example.com -> https://www.example.com
https://www.example.com -> https://www.example.com
Can someone please provide a TESTED and WORKING setup for this using FORCED HTTPS? Should i host my certificate on DNSimple or Galaxy? Should i add both domains on galaxy? What will my ALIAS and CNAME record be?
Im hosting on eu-west-1.galaxy-ingress.meteor.com .
Thank you!
The http:// and https:// are irrelevant to the DNS records, they are just telling your browser what protocol to use. example.com and www.example.com are two different Fully Qualified Domain Names (FQDNs), and both need A records to the static ip. So you would make a record on your root zone # IN A static-ips (# means zone root so equivalent to example.com. IN A static-ips), and you would need a second record for www, www. IN A static-ips). This will make sure both go to the right ip
Now for the ssl certificate, the cert has to match the FQDN that the browser is trying to access, so if you only have a cert for example.com, then it will fail for www.example.com, if this is the case you can make a new cert with the common name example.com, and add the Subject Alternative Name (SAN) www.example.com to the cert during creation, this will make sure it works for both
If you want users who access http://example.com to go https://example.com, then that can't be done through DNS, server side or client side you will have to detect this and redirect to https, and depending on what you're using to host your app (e.g. apache, node, etc), there will be more documentation on that

Godaddy URL redirect from HTTP to HTTPS

I host my website on heroku and bought the domain from godaddy, here's how I set my DNS records
Records
A - # - Forwaded - 600 secs
CNAME - www - example.com.herokudns.com - 1 Hour
Forwarding
-- Domain --
Redirect to https://www.example.com
-- Subdomain --
example.com Redirect to https://www.example.com
www.example.com Redirect to https://www.example.com
Expected Behaviour
When I enter example.com or www.example.com, it should redirect to https://www.example.com
Result
Only example.com got redirected to https://www.example.com, www.example.com does not
What went wrong with my configuration ?
You can't have www as a CNAME and also www as a redirect. If you have the www CNAME aliased to example.com.herokudns.com it's going to go directly to your app on Heroku and make a connection. Your app must be the one to force the redirect to https at that point. I don't know what language you are using, but if it's Rails then set config.force_ssl = true in production.rb.
If your domain is pointing at Heroku with an A and a CNAME record, then the "forwarding" settings on GoDaddy will have no effect. To implement forwarding, GoDaddy points the domain to their own servers.
Once you point the domain at Heroku, all HTTP to HTTPS redirects have to be implemented at Heroku. You can no longer use Godaddy's forwarding. In any case, GoDaddy's URL forwarding is badly implemented and unreliable. You should never use it. See GoDaddy's 301 redirect/forwarding has some weird random middleman URL, kills link juice?
How to redirect HTTP to HTTPS at Herouku depends on what programming language you use. Basically, the redirect rule has to be programmed into your application. See their documentation for specific instructions for a variety of cases: Can Heroku force an application to use SSL/TLS? - Heroku Help
To actually use the Domain as the Web Address:
The A Record should be the IP Address
The CNAME only needs to be name: www value: #
Also I like to keep the TTL the same for the A and CNAME records.
Wait about an hour before testing to ensure the servers have propagated.
For Domain forwarding you only need to scroll down to Forwarding and select https or http (make sure that is correct). Then the web address/url to the home page.
Use a permanent redirect for SEO.

Checking SSL works before migrating a site

I have a website on server 1 that has an SSL certificate, I need to move a new developed site to server 2 which has a new SSL certificate. The SSL has been installed on server 2, is there anyway to check if the site and the ssl certificate works before changing the nameservers from server 1 to server 2.
I have tried editing the hosts file on my computer with the IP address of server 2 and the site loads, but as it only shows the IP address in the url bar so there doesn't seem to be a way to tell if the SSL is working, if i add https:// to the domain IP it doesn't work.
Thanks in advance.
When you change the hostfile to the second server with the correct domainname it should listen as if it were used from a nameserver from the outside world.
For example, if you want to test server 2 with IP 194.194.194.194 with the domainname www.example.com you should add this line to your hostfile:
194.194.194.194 www.example.com
After you add this it is possible to go to https://www.example.com which should serve you the certificate if everything is configured right.
Cheers!

Server does a 301 redirect when connecting with browser, shows IP instead of domainname

I'm running LEMP on a linode server, bought a domainname from louhi.fi.
All I have are A records pointing to the IP, although I have them booth on linode and on louhi(could this be the problem?)The domainname does resolve to the server, but because of this 301 Redirect the address bar displays the IP. I don't know if the 301 is serverside or DNS side. When I initially configured the DNS, Louhi did have a URL record pointing at the IP address which I removed(which I thought was weird), but I'm not sure if that's the problem. It might just be I have to wait until the DNS updates.
I've tried everything I can with the nginx configuration. I'll probably wait until tomorrow before doing any more DNS meddling, to make sure they've applied any changes.
Appreciate any help!
The issue was with wordpress. I had simply forgotten to change the site url and wordpress url settings.

Resources