Redirect/Redirecting http to https by using .htaccess file – Step By Step Guide

81 / 100 SEO Score

If you want to redirect HTTP to https in WordPress or HTML website by using a .htaccess file. If a very easy job. In this post, we will cover how to redirect HTTP to https by using a .htaccess file. Also, we made one video to understand the process better.

If you are doing SEO on your website & you are getting the potential traffic you must redirect you HTTP to https. If you will not do this you will face below consequences.

    1. Your website has two version 1. HTTP 2. Https. It means that your website will count as a duplicate website.
  1. If you will redirect HTTP to https in WordPress or HTML website by using a .htaccess file. Your SEO will hurt and ranking will go down.

How to redirect/redirecting HTTP to https in WordPress or HTML website by using a .htaccess file

Now Let’s understand the process of redirecting HTTP to https on Linux server. There many steps to finish this job. We have broken down into below steps.

A. WordPress Setting

1. Login your WordPress Account

2. Go to setting and to General Section.

Wordpress General Setting - Digital Upendra

3. In general Section, You will find below Steps

WordPress Address (URL)

Site Address (URL)

Wordpress And Site Address4. Now you have to update from Http https.

5. Save changes.

B. Linux Server Setting Steps –

    1. Login your C-panel Account.
    1. Go to file manager
  1. Find the .htaccess file (Make a note it is a hidden file you have to unhide your .htaccess file from your account’s top right corner setting gear icon.

c panel setting

htaccess file setting4. Now your .htaccess file is open & start editing file considering below things.

For Instance – 

WordPress .htaccess Content

If your WordPress site should already have a default entry in your .htaccess file. It should look similar to this example:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

# BEGIN WordPress

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

To ensure your hosting account will force the HTTPS protocol on all traffic to the site, you’ll need to add the following to the .htaccess file.

RewriteCond %{HTTPS} !=on

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

You’ll need to place the code snippet after the RewriteBase / in the .htaccess file. It should look similar to the following example:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteCond %{HTTPS} !=on

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN WordPress

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

You can also read this article Click Here!

Read More

How to Make Money from online Blogging?

Free Indian Classified Submission Sites List

7 Best Drag and Drop WordPress Page Builders For Non-Techie

Redirect/Redirecting http to https by using .htaccess file - Step By Step Guide
Redirect/Redirecting http to https by using .htaccess file - Step By Step Guide - Digital Upendra

If you want to redirect HTTP to https in WordPress or HTML website by using a .htaccess file. If a very easy job. In this post, we will cover how to redire

Editor's Rating:
4

Add a Comment

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