Apache mod_rewrite Infinite Loop when Accessing WordPress Admin Dashboard

Looks like this was a duplicate (alas, one that eluded me for 2 hours)!

https://wordpress.stackexchange.com/questions/170165/wordpress-wp-admin-https-redirect-loop

I needed to add this to my wp-config.php:

/** SSL */  
define('FORCE_SSL_ADMIN', true);  
// in some setups HTTP_X_FORWARDED_PROTO might contain  
// a comma-separated list e.g. http,https  
// so check for https existence  
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)  
    $_SERVER['HTTPS']='on';

Leave a Comment