Help Docs Control Panel Guides Cloud Sites Guide Website Management in Cloud Sites SSL for Cloud Sites Force a Secure Connection (SSL) Using web.config in Cloud Sites

Force a Secure Connection (SSL) Using web.config in Cloud Sites

To force SSL on all pages of your site using the IIS Rewrite Module you can use code similar to what is provided.

Note:

The code provided below is only an example. Your specific website may require different code. As outlined in our Terms of Service and Cloud Sites Spheres of Support Expectations, we are unable to help you troubleshoot code issues. We recommend speaking with your developer before implementing any scripts.

Once you’ve determined the IIS Rewrite Module is available for your site, you can write the script to force SSL on all pages on your site. An example of the script is below.

<? xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
 <rewrite>
  <rules>
   <rule name="Redirect to HTTPS" stopProcessing="true">
     <match url=".*"/>
    <conditions>
     <add input="{HTTP_CLUSTER_HTTPS}" pattern="^on
quot; negate="true"/>      <add input="{HTTP_CLUSTER_HTTPS}" pattern=".+" negate="true"/>     </conditions>     <action type="Redirect" url="https://{HTTP_HOST}{SCRIPT_NAME}" redirectType="SeeOther"/>    </rule>   </rules>  </rewrite> </system.webServer> </configuration>

There are ways to force SSL on one page or specific pages. For information about the IIS Rewrite Module, you can review the documentation on the Microsoft IIS site and the articles Creating Rewrite Rules for the URL Rewrite Module and URL Rewrite Module Configuration Reference.

Was this article helpful?