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.
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
3. Now go to the setting bar and click on Show hidden files
4. Click on save
5. Now go to the .htaccess file and click on Edit
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.
It’s all done!!!
Now if i open my website it will automatically be redirected to https://
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!!!!