Redirect loop in /wp-admin/

A site I manage has just become inaccessible to the admin today. I just updated apache on the server to enable mod_deflate and also to upgrade PHP from 5.3 to 5.4.

Since doing that every time I attempt to access /wp-admin/ I receive the redirect loop error. I tried all the usual suspects, i.e:

Read More
  • cleared cookies and cache
  • tried different browsers
  • disabled theme
  • disabled cookies
  • deleted .htaccess
  • checked site_url etc in wp_options

But no luck. I can access wp-login.php fine but not /wp-admin/

Any help would be greatly appreciated as I am totally stumped.

Related posts

3 comments

  1. Try renaming the plugins folder to e.g. plugins-, so as to make sure it has nothing to do with them. Switch it back if it’s not the case. If it was, proceed to do similar steps with each individual plugin folder until you locate the culprit.

    The same for themes if you’re still out of luck.

    Another thing, per the comment, would be if the URLs are wrong. Say, the server wants www. and WP doesn’t. Or the server wants SSL admin and WP doesn’t. Or vice versa in each case. Those can very much break a site and trigger infinite redirects all over the place, so be sure to check those too. Adjust the WP config as appropriate using the relevant defines if needed: WP_HOME, WP_SITEURL, FORCE_SSL_ADMIN, FORCE_SSL_LOGIN.

    If all else fails, the usual approach to debug this kind of stuff to die(__FILE__.':'.__LINE__); your way throughout WP until you nail down what is causing the infinite loop. (It could be a cron job or some odd thing like that.)

    By following the script, I mean opening up the wp-admin/index.php file (which in this case is the one getting hit), and inserting die(__FILE__.':'.__LINE__); towards the top — before WP actually does anything. If it’s already redirecting there, it means there’s a problem with the server configuration.

    If not, proceed to move the statement down step by step until the redirect occurs. Move further up, entering the included files and the relevant wp functions as needed, and continue doing the same. At one point, you’ll find the exact statement that is causing the issue.

  2. I had the permissions wrong. 775 instead of 755. Once changed, everything worked.

    Check your folder permissions!

Comments are closed.