1. Download URL Rewrite tại đây và cài vào IIS.
https://www.iis.net/down.../microsoft/url-rewrite1
2. Copy đoạn code này vào IIS. Để trong tab <system.webserver>
Mã:
<rewrite>
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
If the web.config file is missing, you can create a new .txt file, put the aforementioned code there, save and then rename the file to web.config.