How do I force my website to use SSL?

How do I force my website to use SSL? [Important| Latest 2019]

Here in this blog we will try to learn how to redirect any website forcefully to HTTPS.

So Friends!!! As you can see a screenshot of my website below which is clearly saying that your website is not secure .

Now what i will do here is, I will force my website to use SSL.

How do I force my website to use SSL?| cheapest linux hosting provider
How do I force my website to use SSL?

Yes Friends, we can simply do this by putting 3 line code in .htaccess File

Use the File Manager in cPanel to edit the file


RewriteEngine On 

RewriteCond %{SERVER_PORT} 80 

RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]


Step-by-Step Guide to Migrate Your website to HTTPS [Updated May 2019]


1. Login to your cPanel

2. Go inside File manager section and then go to public_html

Buy linux hosting from redserverhost
How do I force my website to use SSL?



3. Now go to the setting bar and click on Show hidden files

Buy cheapest linux hosting from redserverhost
How do I force my website to use SSL


4. Click on save

Buy linux hosting from redserverhost
How do I force my website to use SSL


5. Now go to the .htaccess file and click on Edit

cheapest linux hosting provider
How do I force my website to use SSL


Now edit these codes in .htaccess edit zone

RewriteEngine On 

RewriteCond %{SERVER_PORT} 80 

RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]


Place these codes anywhere you want 


Now in place of www.example.com you have to write your domain name like i have written ritnesh92hub.tk and then click on Save Changes tab.

Buy linux hosting from redserverhost
How do I force my website to use SSL


It’s all done!!!


Now if i open my website it will automatically be redirected to https://

cheapest linux hosting from redserverhost
How do I force my website to use SSL

So you see how simple it was!!

Hope this helps you!!!

For more information and queries related to your website feel free to comment below or you can simply contact Redserverhost.


Thanks for Reading!!!!

Scroll to Top