The Page is NOT Redirecting Properly

Hello, I have a problem when entering my website it appears “The page is not redirecting properly”, and in .htaccess EVERYTHING is fine, in CloudFlare EVERYTHING is fine, in DNS is fine, even Clear the Cache and Cookies for nothing, whoever I helped myself.

NOTE: My CloudFlare SSL/TLS is Flexible and Always Use HTTPS is ON.

I checked the data being sent with the redirect requests. I see that PHP sessions are being set, meaning some of the redirects are generated by your PHP code.

Many website software packages have a Website URL setting of some kind. Please make sure that this is configured to also use HTTPS. Because if you have Cloudflare redirecting everyone to HTTPS, and your website code redirecting everyone to HTTP, you get a redirect loop like this.


How I can fix it???

My .htaccess is in HTTPS and my config.php is in HTTPS, I not understand why it NOT Work.

And the others codes for Forced SSL in .htaccess NOT Work. Example:

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

NOT Work.

Did you also try the .htaccess snippet we recommend you use?

1 Like

Yes and NOT Work :frowning: Please help me

If you’re using WordPress, please make sure WordPress is configured as in this article:

If you don’t use WordPress, then try removing the htaccess snippet which redirects to HTTPS, then make sure the URL on your software is set to HTTP, as Cloudflare Flexible SSL doesn’t support websites being configured for normal HTTPS.


I’ve already tried, and it doesn’t work for me either, when I remove the HTTPS snippet in htaccess and in config.php I change the URL to HTTP, the load, but it DOES NOT let me Login to my Script.

Checking the login form, the page itself uses HTTPS but the login form itself makes requests to

As to why that happens, your guess is as good as mine. It might be configuration error, a bug, or just an odd consequence of using Cloudflare’s Flexible SSL.

So what can I do?.

In my config.php file I have the URL in HTTP, because if I pass it to HTTPS it DOES NOT Load, currently the Web Load in HTTPS by CloudFlare, but in the config.php it is in HTTP, but it gives me the Error that I CANNOT Login, I DO NOT think it is a CloudFlare Error, because at first, when I was Installing the Script, the Installation Page Loaded fine and in HTTPS, but after Installing it, the Error started, I think it is the Script, but I do NOT know What I can do.

I think it’s very likely that this is the cause for the lugin URL issue.

I’m 98% sure that this is caused by Cloudflare’s Flexible SSL.

Most websites check whether you are visiting through HTTPS by checking whether the server gets a HTTPS connection. If you use Cloudflare Flexible SSL, you can navigate your site over HTTPS, but the connection will be with HTTP. So your website thinks you are not using HTTPS and will try to redirect you to HTTPS.

This can be fixed by installing an actual SSL certificate on your website and using Cloudflare’s “Full” SSL mode, or by checking the $_SERVER['HTTP_X_FORWARDED_PROTO'] value instead of $_SERVER['HTTPS'] in the code.

The codes is in config.php or in htaccess??.

Codes are refering to .htaccess. If you install SSL cert on your website then no code is needed. Your preference.

It’s somewhere in the PHP code. I have no idea where it is. It’s probably not in the configuration file. The developer of the software should be able to tell you this.

I understand, I will see if I can solve it, if not I will have to delete that website. :frowning:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.