Search Knowledge Base
Table of Contents
< Go Back To Home

How to Force SSL / HTTPS using .htaccess (For WordPress & All Sites)

If you have a website built on wordpress or any other platform but struggling to see non secured URL then kindly follow the simple process to Force SSL to HTTPS using .htaccess.

  1. Log into your cPanel hosting.
  2. Once logged-in, Find the Files category and click on the File Manager.
  3. Click on Settings tab at the top right corner of the screen.
  4. In the Settings Menu, choose the document root (or folder) for the domain you are working with and be sure the checkbox next to Show Hidden Files is checked. Click the Save button.
  5. Look for the .htaccess file and right click on it. Followed by a click on the Edit option.
  6. A new window will open in form of a text editor.
  7. Paste the below code to redirect http to https (non-ssl to ssl):
RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

NOTE: Make sure that your hosting plan includes RewriteEngine. You can confirm the same from your web hosting provider or consider moving your website to myglobalHOST as we offer managed wordpress hosting which has all the required features to make your hosting experience wonderful.