You can configure your environment to automatically redirect domains to HTTPS using the Domains tab in the Cloud Dashboard.
Tick the HTTPS checkbox next to the domains you would like to redirect to HTTPS, e.g. users going to
http://www.mysite.com will be permanently redirected to
Make sure you have an SSL certificate configured for the domains you specified as HTTPS, otherwise a default certificate will be used and will cause browser errors.
This approach is preferable to redirections via
.htaccess, since it applies to all requests to a specific domain (not just ones handled by Apache). It’s separate from URL Rules, which deal with path-based redirects. Using SSL consistently on websites is considered best practice, but if you need conditional SSL redirects, please refer to Director::forceSSL().