Website redirect setting for https:// prefixed naked domain - https

I have a site registered on Google Domains and deployed on an Azure VM, HTTPS enforced via the IIS webconfig file. It all works fine, except for 1 piece:
https://mywebsite.com results in "this page cannot be displayed, mywebsite.com unexpectedly closed the connection."
https://www.mywebsite.com works fine, as does the unsecure naked domain redirect (http://mywebsite.com; it redirects to the https://www prefixed link, I have set this up this Permanent redirect in Google domains).
Given the above, what setting (on my Azure VM SSL binding, or Google Domains, more likely) could I change to make sure if someone types in https://mywebsite.com, they will reach it?
Thanks!

Do you have a binding listening on port 443 to mywebsite.com? This should solve the issue.
cheers

Related

Why is my Google domain not directing to https?

I deployed an app on Heroku and set up automatic SSL configuration. According to my Heroku, my app can be accessed via https. If I use that URL, the connection is indeed secure.
I added a Synthetic Recored in my google domain to point to this url. I also added a Custom Resource Record where the Name is www, Type is CNAME, and Data is my DNS Target for the app.
I can only connect securely when I use https://www.osrshub.com. If I use www.osrshub.com or osrshub.com, it is not secure. What am I doing wrong?
The comment from user2864740 is correct. I needed to update my front end to redirect to https.
Force SSL/HTTPS with mod_rewrite

Sharing link from mobile browser shows ip instead of domain name

I have a domain, ‘example.com’ and when I share some of its web pages via a mobile browser (only in Safari and chrome app) to social media, the URL is displayed as an IP ex(http://31.08.94.4:99999) instead of my domain name.
I'm working in laravel framework.
For a clear understanding, I updated screenshot below,
This is the screenshot of what happens when I share from my mobile:
http://prnt.sc/nkxfj5
And this is what happens when the proxy IP is shared instead of the actual domain name:
http://prnt.sc/nkxg8f
I got an solution for this issue,
canonical url of site is used while sharing the site.
So check your canonical url set in your site using,
document.querySelector('link[rel=canonical]');
This could be something on your webserver side. Are you using Apache? In that case check your virtualhost settings to make sure no direct access is even possible and it's set to your domain. For Nginx I'm not sure. Did you also check your DNS settings?

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

how to set https for naked domain?

I have been using openshift for quite some time. Since letsencrypt is in beta, I thought I gave it a try.
My current setup:
www.digrin.com is an alias to my openshift url - digrin-digrincom.rhcloud.com
digrin.com A tag points to wwwizer redirect service 174.129.25.170.
I have uploaded ssl certificates to openshift. It works fine on domain www.digrin.com. However since naked domain digrin.com points to wwwizer.com, it does not use https. I believe it is a problem. I want both domains (naked as well as www variant) to use https. Is it possible? I know wwwizer has some premium plan where it might be possible, but I would like a free version if possible.
If you don't know, I can not set cname for naked domain, so I had to use A tag to wwwizer, because openshift might change IP address.
Useful link:
How to use naked GoDaddy domain with OpenShift hosting?
If you are looking for a free (1 domain) service that redirects naked domains with valid SSL certificates. I moved from wwwizer to nakedssl to redirect to an Opensift server and it works fine.
Well first of all I had to generate ssl certificate for naked domain - digrin.com. I set temporarily A tag for digrin.com to openshift's ip and generated ssl certificate.
Now we have working certificate, but since A tag for digrin can not be set permanently, domain registrant must support naked domain redirect. More on this you can read here -> if you registrant does not support it, move to cloudfront (I will test cloudfront if my registrant will not add this feature within few months and will update this answer).

Redirecting naked domain to www with DNSimple

We're using DNS simple to point our domain to our SSL-enabled Heroku app. The behavior we're seeking is as follows:
http://ourdomain.com
https://ourdomain.com
http://www.ourdomain.com
Should all permanently redirect to:
https://www.ourdomain.com
We've already created a CNAME for www.ourdomain.com that points to our app's .herokussl.com domain, but we're not sure what to do with the naked domains. In GoDaddy, we used to do non-masked forwarding. DNSimple doesn't have forwarding, but does have special entries called ALIAS and URL, though we're not sure what to use.
To configure a redirect you should use an URL record as described in our redirect documentation.
However, it's not possible to redirect an HTTPS URL because of the priority between SSL negotiation and HTTP headers. In this case, because you also want https://ourdomain.com to redirect to https://www.ourdomain.com, then you need to create an ALIAS for ourdomain.com to your Heroku SSL endpoint and handle the redirect in your app.

Resources