In Plesk, go to Domains > example.com > File Manager, open the web.config file and put the following content right before </system.webServer>:
Note: If the <rewrite>/<rules> sections are already present in the web.config file, put the content below without tags <rewrite><rules>… </rules></rewrite> inside the existing <rules> section.
<rewrite>
<rules>
<rule name=”HTTP to HTTPS redirect” stopProcessing=”true”>
<match url=”(.*)” />
<conditions>
<add input=”{HTTPS}” pattern=”off” ignoreCase=”true” />
</conditions>
<action type=”Redirect” redirectType=”Permanent” url=”HTTPS://{HTTP_HOST}/{R:1}” />
</rule>
</rules>
</rewrite>