How to force your site to use SSL (HTTPS) using

First of all, you will need to install an SSL certificate to your site

Once your certificate is installed, you will need to redirect from ‘HTTP://’ to ‘HTTPS://’ – this can be easily achieved from within cPanel, or by modifying the .htaccess file. 

 

Force HTTPS:// using a WordPress plugin

There are tons of plugins available for this purpose, however, the one we recommend is called ‘Really Simple SSL’ – this can be downloaded in WordPress via the Plugins section of your Dashboard. One thing you will need to also do when setting HTTPS:// for your WordPress site is to ensure your ‘Site URL’ in Settings -> General also have ‘HTTPS://’ in.

 

Force HTTPS:// in cPanel

To redirect your domains to the secure HTTPS:// version of your site, this can be done easily through the following screen...

cPanel -> Domains

From here, you would need to select the following option...


Force HTTPS:// via a .htaccess file


To force all web traffic to use HTTPS insert the following lines of code in the .htaccess file in your website’s root folder. 

Important: If you have existing code in your .htacess, add this above where there are already rules with a similar starting prefix.


RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]


Be sure to replace www.example.com with your actual domain name. To force a specific domain to use HTTPS, use the following lines of code in the .htaccess file in your website’s root folder:


RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]


Make sure to replace example.com with the domain name you’re trying force to HTTPS. Additionally, you need to replace www.example.com with your actual domain name. If you want to force SSL on a specific folder you can insert the code below into a .htaccess file placed in that specific folder:


RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.example.com/folder/$1 [R,L]


Make sure you change the folder reference to the actual folder name. Then be sure to replace www.example.com/folder with your actual domain name and folder you want to force the SSL on.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 How to create 'Snapshot Backups' via the JetBackup interface

Backups are taken of all accounts on our shared and reseller services daily. However, we do...

 Connect to your server via SSH

SSH allows secure file transfer and remote logins over the internet. Your connection via SSH is...

 How do I change PHP versions, or change my PHP settings / config?

The process of setting your PHP version and the 'variables' (such as memory_limit values) differs...

 How do I install a free SSL via cPanel?

Installing an SSL certificate in cPanel is easy! Best of all, it's free with WebGee!Important:...

 How to send emails in WordPress using the WP SMTP Mail plugin

Instead of using the default PHP mail() function, you can send emails using our SMTP services via...

Powered by WHMCompleteSolution