How to Force the Use of SSL on Your Domain

If you have already purchased and installed an SSL certificate on your hosting account, you may be interested to force each access on your site to the secured version protected by SSL, and which uses the secure HTTPS protocol.

Since the end of 2014, Google has announced that web sites displaying their entire web site over HTTPS and using valid SSL certificates will receive a slight boost in their search engine rankings over other sites that may not be using SSL. As such, WHC strongly recommends to deploy this configuration once you have purchased and installed an SSL certificate.

To force SSL on all your domain, you will need to create a file called .htaccess inside your public_html folder. If this file already exists, you will need to update it. You may create and update your files using the File Manager in your cPanel or any other file management tool of your choice (such as FTP). Add the following lines to your .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]

If you are using "www" in your domain address, please use this code instead:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://www.yourdomain.com/%{REQUEST_URI} [R,L]

You will need to replace "yourdomain.com" by your actual domain name.

Please note that certain web applications, such as the Site Builder, Wordpress, Drupal, and Joomla require an update to their settings in order to force SSL across your entire domain. Please refer to each application's documentation for details, or contact our support team for assistance.
  • 0 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה

מאמרים קשורים

Enable two-factor Authentication on Wordpress

Following numerous hack attacks / brute force hack to WordPress, we recommend that you install...

How to Block a Domain or IP Address

This article is intended for advanced users only. Please do not block IP addresses unless you...

SSL Certificates: Ordering, Installation, Errors

Note: SSL certificates are to be installed only by qualified WHC technicians. Introduction An...

How to turn off/on ModSecurity firewall rules on your account

About ModSecurity Firewall RulesEach web hosting account with Web Hosting Canada is protected by...

How to Unblock Your IP From Our Firewall

The Web Hosting Canada Firewall protects your account from hackers, malware, and other security...

Powered by WHMCompleteSolution