How to redirect website from HTTP to HTTPS (Forces HTTPS Redirect)

After installing an SSL you must redirect HTTP to HTTPS. it is mandatory because if a user opens your site using HTTP URL then he will not see SSL on your site. So, it is compulsory that you must redirect your HTTP site to HTTPS. For doing this simply follow these simple steps

1. First of all login to your cPanel.

2. Open File Manager of your cPanel.


3. Open Your Domain Document directory.

The document directory of the primary domain is public_html and the document directory of the addon domain is a folder created by the name of the domain itself.

4. Search and select the .htaccess file and click on the edit button. (Make sure to create a backup of your .htaccess file before edit it).

 if you donโ€™t find .htaccess file then enable hidden files option from settings located at the right corner.

5. Add this simple code there and save changes.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Congratulations your site is successfully redirected to HTTPS secured SSL URL.

Leave a Reply 0

Your email address will not be published. Required fields are marked *