Setting IIS for https and domain
1.
Site Binding
Type |
Host Name |
Port |
ID Address |
Binding In |
http |
|
80 |
·
( All Unassigned) |
|
http |
www.b2b.bce.net.au |
80 |
* |
|
http |
b2b.bce.net.au |
80 |
* |
|
https |
b2b.bce.net.au |
443 |
* |
|
https |
443 |
* |
In SSL certificate, select its name |
2.
Advance setting
3.
SSL Setting
Client certificates: Ignore
4.
Redirect
Add rule -> Blank Rule
We type a Name for the new rule
and in the Matched URL section:
·
We set the Requested URL dropbox to Matches the Pattern
·
We set the Using dropbox to Regular Expressions
·
We type (.*) as the Pattern
·
Check the Ignore case checkbox
We expand the Conditions section and select Match All in the Logical grouping dropbox, and then click the Add button.
A new popup window will open, we set the following values and press the OK button:
·
Type {HTTPS} in the Condition input textbox
·
Set the Check if input string dropbox
to Matches the Pattern
·
Type ^OFF$ in the Pattern textbox
·
Check the Ignore case checkbox
And the new condition will be added to the Conditions section
In the Action section, we need to configure the
following settings:
·
In the Action type dropbox, we
select Redirect
·
In the Rewrite URL, we type https://{HTTP_HOST}{REQUEST_URI}
·
We uncheck
the Append query string checkbox
·
We set Redirect
type to Permanent
(301)
Finally, we click on the Apply button, located on the Actions menu (right part of the console).
Manual Update of the
web.config File
We open the file web.config, located on the
folder of your website, and for search for the <system.webServer> section.
Add or edit the rewrite section, with the following
code:
<rewrite>
<rules>
<rule name="HTTP-to-HTTPS-Redirect"
stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
https://gmusumeci.medium.com/how-to-setup-http-to-https-redirect-in-iis-1e382fa17512
Comments
Post a Comment