Cannot redirect to HTTPS

Hi everyone,
I used the following code in my .htaccess to redirect all my traffic to https:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

And it worked very well until last week, when my sites got blocked and began to say: “TOO MANY REDIRECTS”

Please help me

Use this code:

RewriteCond %{HTTP:CF-Visitor} ‘“scheme”:“http”’
RewriteRule ^(.*)$$1 [L]

Are you using Cloudflare? And are you using Flexible SSL? If so, the provided .htaccess code does not work because Cloudflare uses http to connect to your website.

If you’re using Cloudflare, it’s better to use Page Rules to do the https redirect.