I was pleasantly surprised to see that CloudFlare had started providing a free SSL certificate to all its users, my site included.
I use a WordPress plugin to force HTTPS SSL on my pages, but the site is still accessible by HTTP, which leads to display issues. I want to force the native HTTP redirection to HTTPS in my .htaccess, but when I tried a redirect, I came across an infinite redirection loop.
How can I solve this?
I was pleasantly surprised to see that CloudFlare had started providing a free SSL certificate to all its users, my site included.
I use a WordPress plugin to force HTTPS SSL on my pages, but the site is still accessible by HTTP, which leads to display issues. I want to force the native HTTP redirection to HTTPS in my .htaccess, but when I tried a redirect, I came across an infinite redirection loop.
How can I solve this?
I am answering this old question, as it still remains unanswered. Instead of using the plugin, you should use cPanel to redirect HTTP to HTTPS. It will help you to get rid of the infinite redirection loop issue. Follow these steps:
A new tab will show up. It will contain the codes of .htaccess. Copy and pasted this code to .htaccess file:
RewriteEngineOn
RewriteCond%{HTTPS}off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
You can find more information about these steps here.
If you see mixed content and face trouble with the redirection, you will have to use Really Simple SSL plugin. It will fix the issue completely.
Put this code in .htaccess
file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]