Redirect http to https problem

I’m using free host and actived free ssl with flexible option.
I selected always on https.
Now i have two index of my urls with http and https in google index.
I try this htaccess code for redirect http to https:

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

but i see this error in chrome.

This page isn’t working redirected you too many times.


please help


You can enable this option directly in Cloudflare.
Your error is because your htaccess tries to redirect forever, and therefore Chrome ends up stopping trying.

If you wish to enable this in Cloudflare, visit your dashboard > SSL/TLS > Edge Certificates > Always Use HTTPS. You won’t need the .htaccess file to redirect to HTTPS anymore!

Have a great day!

This topic was automatically closed after 30 days. New replies are no longer allowed.