Http to Https Redirect



When we install https on our wordpress blog, then the most important thing is to redirect your blog links to http to https so that traffic starts coming to your new version, this step is very important for search engine optimization. But the problem increases when you add http to https redirection code, then it does not allow your site to load properly on the browser.
This problem comes to many people, but now you do not need to worry.
When you install SSL on a wordpress site then the most important thing is that our content search engine has already been indexed, which is https without redirecting it to https so that when a visitor came from Google search redirect to https link. With this, our traffic loss is completely avoided, meaning there is no kind of organic traffic loss.

Correct http to https redirect code for WordPress Site :

Before that I told you about the https redirection, it is very necessary to tell one thing before that this htaccess & http to https redirection code work on this condition Do your blog set up on www or is built on non-www. If your blog is open with www such as www.bloglon.com then you should add the wordpress https redirect code below to the top of your blog's htaccess file.
Here is the code, you need to input your htaccess file.

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


RewriteEngine On
RewriteBase /
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

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:


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]

My Account Contact Us Support TOS Privacy Policy Unlimited Hosting Policy FAQ.
Refunds and Cancellations
Tutorial

In order to optimally design our website and to show appropriate offers we are using cookies. By continuing to use our website you agree that we set cookies. More information