In cPanel, you can redirect all your web site traffic to HTTPS through .htacces file. Here are the steps to get it done.

Step 1 :

Log-in to the cPanel and navigate to file manager, public_html folder

Step 2:

If there is .htaccess file, open it using a text editor in file manager.

** If there is no any .htaccess file, you can create a new file and name it as .htaccess

Step 3:

Add following line on top the .htaccess  file

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

Notes :

  • Do not duplicate RewriteEngine On.
  • Make sure the lines beginning RewriteCond andRewriteRule immediately follow the already-existing RewriteEngine On.

Hint :

If you are unable to see .htaccess file in your cPanel public_html folder (even you create one), you need to enable ‘Show hidden file’ option in your cPanel

  1. 1. Click on settings icon in your cPanel file manager,
  2. 2. Enable the option ‘Show hidden file’