Reputation: 4570
I bought a SSL certificate from some company and i have installed it on my Windows 2016 server IIS 10.and it's bind like below image.
When i type https://example.com it works fine... BUT when i type just example.com then it goes to IIS default site. as well as when i type https://www.example.com it works fine but when i type just www.example.com then it goes to Default IIS site.
This means when i type https:// then it works fine... But normally users type example.com or www.example.com .. So how can i configure thisone for the above requirement ?
Upvotes: 0
Views: 32
Reputation: 3504
When you type in example.com or www.example.com in web browser, the client will just send a request over http instead of https like http://example.com.
Since you need https for your website so Require SSL will be checked. You can't host both http and https binding under the same site. Otherwise, Require SSL handshake will corrupt URL redirect rule.
Please install URL rewrite module and put this rule under your Default Website.
<rule name="HTTPS force" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
Upvotes: 1
Reputation: 63289
That's exactly what your current site bindings will lead to,
https://docs.jexusmanager.com/tutorials/binding-diagnostics.html#background
So my suggestions are,
Upvotes: 1