Recently I installed CloudFlare’s Free SSL onto my site, and changed my site URL to https:// through the WordPress settings. All of the sudden, everytime I tried to go to /wp-admin, it would die in a redirect loop. There are a bunch of plugins out there that offer functionality that they say fix this, but I don’t want a bunch of plugins that run extra code and run event on the frontend slowing my site down. You simply have to add 4 lines of code to your wp-config.php file to fix the wp-admin redirect loop error with CloudFlare Free SSL.
Place Code On: Anything line above the wp-settings.php require_once
if( isset($_SERVER['HTTP_CF_VISITOR']) && strpos($_SERVER['HTTP_CF_VISITOR'], 'https') )
Conclusion: Once this code is in place, you should be able to login to wp-admin with your site URL set as https:// and not get a redirect loop error.