Hostreek.com

How to force redirect your website HTTP to HTTPS using .htaccess?

We’ll tell you, how to force redirect your website from HTTP to HTTPS using a .htaccess file?

You must have followed these steps below to force redirect your website HTTP to HTTPS –

Step 1: Log in to cPanel

Step 2: Type “file manager” in the search bar and click on the it

Step 3: Click on the Public_html folder in the file manager

 

Step 4: if you didn’t find the ‘.htaccess’ file in the file manager then go to the setting at the top right corner and tick the “Show Hidden Files (dotfiles)” option then click the “Save” button.

Step 5: Select the .htaccess file and open it in edit mode

Step 6: Paste this code (Given below) at the top of the .htaccess file then, click on “Save Changes” at the top right corner.

  • RewriteEngine On
    RewriteCond %{HTTPS} on
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Congratulations, you have successfully redirected HTTP to HTTPS using the .htaccess file.

If you still have any doubts please let us know through comments.

How to update nameserversClick here 

 

Leave a Reply

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