One of the most common requirements, when we set up an IIS web server and we install an SSL certificate is to enforce HTTPS protocol.
In this story, we will learn how to configure IIS to redirect HTTP to HTTPS automatically.
These steps are applicable to Windows 10, Windows Server 2016, and Windows Server 2019.
Install Requirements
We need to download and install the IIS URL Rewrite module. Then, we launch the Internet Information Services (IIS) Manager and validate if the URL Rewrite module is installed.
Disable SSL Settings
This step is required to avoid the 403.4 forbidden error when we enable HTTPS redirection.
We need to select our website, then the SSL Settings option.
After that, we need to may sure the Require SSL checkbox is not checked.
Create URL Rewrite Rules
We select our website and double-click on the URL Rewrite icon.
and then, we click on the Add Rule(s) located in the right-side menu.
We select Blank Rule in the Inbound Rules section, then press the OK button.
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…