PHP Programming

Fix WordPress Cloudflare HTTPS Redirect Loop

If you use Cloudflare flexible SSL certificate to use HTTPS, in some case you may get redirect loop.

I believe it is caused because WordPress does not recognize the “fake” SSL certificate.

Fixing it is simple.

Open your wp-config.php file, and find this first line


After that line, you can add this PHP code

$_SERVER['HTTPS'] = 'on';

In my case, i modified it into this :

	$_SERVER['HTTPS'] = 'on';

Now wordpress should work properly 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *