For a properly configured web server with IIS on Windows, it is advisable to use HTTPS and SSL.
In this article, you will see how to redirect the port to serve content over HTTPS.
For web server installation and configuration, you can see the process in the article: Domain configuration in IIS with Windows Server.
To enable SSL on your server, you can review the article: How to install a Let’s Encrypt certificate on Windows Server (IIS).
Server preparation.
To set up the redirect, we will need to download the following module : URL Rewrite.
Installing the module is as simple as opening the file, clicking the option instalar and then I Accept.
Redirecting to HTTPS
Now that you have the URL Rewrite module, you can go to the website you want to modify and open the corresponding module:
Once inside, go to Add Rule:
Select Blank rule:
Give the rule any name you want, then leave Requested URL and Using at their default settings.
In the Pattern section, add (.*):
In the Conditions section, click Add:
Set the conditions as follows:
- For Condition input, enter: {HTTPS}
- Leave Check if input string at its default setting.
- In Pattern, enter ^OFF$.
Once it matches the screenshot, you can click OK:
In the Action section:
- Set Action type to redirect.
- In redirect URL, enter: https://{HTTP_HOST}{REQUEST_URI}
- And clear the Append query string checkbox.
Once everything is set up, you can click Apply:
To apply the changes, you will need to restart the website:
Remember, if you have questions about this or any other issue related to your servers at Clouding, feel free to write to soporte@clouding.io We are here for whatever you need. Get in touch!