Press "Enter" to skip to content

WordPress: too many redirects

bist 0

When using the full encryption setting in cloudflare and forcing https in the wordpress config you can get the too many redirects error. This happens when accessing the admin inteface.

To solve this.

I added the following to wp-config.php:

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
   $_SERVER['HTTPS']='on';
else
   $_SERVER['HTTPS']='off';

This solves the problem.

Leave a Reply

Your email address will not be published.