Knowledge Base

How to force HTTPS on websites

Greetings !
This is a tutorial to force everyone who visits your website, to use a secured link ( HTTPS:// with a green bar ).

You may have installed SSL, but it does not show as secured to your visitors like below

This is because, when normal people type, it loads ( which is not secured ).
However, if people type, it will load the secured site like below

The reason is because as of 2018, not every website has SSL certificates, and many normal people do not know about it/care about it.

So, you most probably want users who type , to automatically go to .
To do this, you need to create/edit a .htaccess file, which redirects all traffic from your domain to your https website.

Follow these steps

Step 1: Login into your control panel, and click on File Manager


Step 2 : Click on "public_html" folder


Step 3 : Now by default, .htaccess files are hidden from file manager, to view them, you need to change some settings in File Manager. On the top right, click the settings button

Then click the tick on the "view hidden files" and click save.

Step 4 : Now you can see if there is a .htaccess file in your public_html directory. If it does exist, you can skip step 4 and jump to step 5. If it does not, follow these instructions.
Click on "Add File" like below

Then create a .htaccess file like below, and click create file

Step 5 : Now in your file manager, you can see a .htaccess file. Right click it, and click edit, like shown below

Step 6 : Click on edit, and add the following lines in the file

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]


Step 7: Click on "save changes"

Now, all traffic to your site will be redirected to a secure site !
Try typing in your browser, and it will automatically load !

Please rate this article to help us improve our Knowledge Base.

44 1