01-06-2019, 12:12 PM
WordPress allows you to enforce SSL / HTTPS for the admin area by entering the following line into your wp-config.php file.
However, in some scenarios this setting alone would cause ‘Too many redirects‘ error. To fix this, you will need to add the following code to your wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’.
// 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)