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:

  • 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.

  • Have you recently moved wordpress?
    – Howdy_McGee
    Commented Nov 12, 2013 at 15:10
  • where are you redirected to? do you have errors in the php log? what happens if you disable mod_deflate?. frankly I find it unlikely that any of those changes will cause that, are you sure you haven't done anything else? Commented Nov 12, 2013 at 15:25
  • @Howdy_McGee - no, the site has been in the same location for the last few years. The only real change has been the PHP version today which seemed to trigger the issue. I'm not receiving any errors though. Commented Nov 12, 2013 at 15:25
  • @MarkKaplun - I know it seems extremely unlikely but apart from updating Apache (and the only change there was the addition of mod_deflate) and the PHP version update I'm not aware of making any other changes. Commented Nov 12, 2013 at 15:26
  • 1
    then it is your php upgrade, not sure how but that is probably a new library being used in PHP 5.4. maybe this is not the best place to get help any longer and the regular stackexchange will be better Commented Nov 12, 2013 at 15:57

3 Answers 3


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.

  • WP_HOME and SITEURL both seem fine. It also doesn't seem to be an issue with SSL. Out of curiosity I put the url into tools.pingdom.com and found that the /wp-admin/ url just redirects to itself again and again returning a 302 response header. Can you please explain the die(__FILE... method in more detail. Thanks for your help so far Commented Nov 12, 2013 at 15:23
  • @JoeSpurling: done. Commented Nov 12, 2013 at 15:55
  • thanks for the insight - I'm sure that will come in handy one day. This time the solution was to downgrade my PHP version back to 5.3 Commented Nov 12, 2013 at 17:26
  • @JoeSpurling: I'm quite certain the WP core team would like to know about the issue. If possible, head to the Core trac and post steps to reproduce it. Commented Nov 12, 2013 at 17:46
  • I would normally do so but I'm concerned that my issue was more likely a server configuration issue. I haven't heard of anybody else having issues with Wordpress just because of PHP 5.4. Commented Nov 13, 2013 at 15:47

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

Check your folder permissions!


Temporary solution in the end was to downgrade PHP version back to 5.3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.