force ssl htaccess

Sometimes your website cannot redirected to SSL connection after installing SSL Certificates. In this case, you can forcefully redirect your website non SSL to SSL. To do so, you have to edit .htaccess file.

Force SSL htaccess

Step-1: Login to cPanel > Filemanager.

Step-2: Go to your website directory. (for your main service domain, public_html is default website directory)

Step-3: Locate .htaccess file and right click on it and select edit.

Step-4: Paste the below code and save!

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Now clear your browser cache memory and reload the website again. You’ll see, it is loading with https.
NOTE: .htaccess file is hidden in your cpanel filemanager. To see the file click the gear icon at the to right corner and check show hidden files. If still don’t find .htaccess file, create a new file from the top bar option and name it .htaccess

Like This Article? Get Cloud Hosting Today
Leave a Comments