Surfe.be - passive income

How to Redirect website from http to https

Here is the exact code to redirect website from http to https using .htaccess file.

After installing SSL certificate for your website. Please follow the steps mentioned below to Redirect website from http to https using .htaccess file

  1. 1 : Login into your site cpanel.
  2. 2 : Open File Manager and get into public_html directory (check the option show hidden files
  3. 3 : Select .htaccess file and open with code editor.
  4. 4 : Copy and Paste the below code in the starting of the
  5. 5 : .htaccess file.
  6. 5 : Save it and open your site in the new tab and check it, your site will be redirected from http to https.

Redirection code starts

Copy those code and paste it into .htaccess file and save the .htaccess file .

redirect code


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

Please, comment below if your have any queries or doubts regarding to this article. Thanks

Leave a comments

LET'S SOCIALITE

Recent Tweets

RECOMMENDED POST