Force a Secure Connection (SSL) Using .htaccess in Cloud Sites
Ensure all visitors access the secure (https) site, even if they enter http in the URL, for Cloud Sites with SSL. Edit the .htaccess file to achieve this.
If your Cloud Sites uses an SSL, you can make everyone visit the https (secure) site, even if they type “http” in the URL. The way to do this is by editing your .htaccess file. Read about .htaccess before trying the rule samples below.
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 troubleshoot code issues. We recommend speaking with your developer before implementing any scripts. |
Remember to replace “YOURDOMAIN” with your actual domain name (site URL).
#Force SSL on entire site
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://YOURDOMAIN/$1 [R,L]