Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php

  • When I try logging in to wp-admin (or even wp-admin/index.php) I simply get redirected to my site’s homepage. (after authenticating successfully – i.e. It DOES accept my login credentials (so its not an account, password or blacklisting issue), but simply wont go to the admin dashboard page after login) (I suspect it may be an infinite loop that is occurring?? – how do I find out?)
  • But I CAN login if I go directly to the wp-login.php page, which is weird. (but this is not acceptable as I need users to be able to login through a custom login page again)
  • This came about seemingly randomly (I hadnt changed anything in a week – just woke up one day and couldnt log in)
  • Preceding factors:
    • I havent moved the site at all
    • I havent changed the domain, urls or anything
    • no cache-ing plugins present

The week before I had: Updated WP to 4.8 Updated PHP from 5.4 to 5.6 (to allow installation of an SEO plugin add-on – ‘SEO framework extension manager’)

But it had been working fine for days.

  • So to given some reporting this after PHP upgrade, I tried setting my PHP back to 5.4, but no luck.
  • then up to 5.5, and then back up to 5.6 again – still no fix.

I do also have a membership plugin that renames the login page to /login (But that has worked fine for years too)

I have tried all the usual fixes for wp-admin login issues: – I have tried multiple browsers, and cleared their cache and cookies – no fix. – I have disabled every plugin one by one (via ftp folder rename) – no fix. – even re-updated WordPress to 4.8 again (in case any of the core files needed replacing)

  • checked file and folder permission are all correct (644) via FTP – all fine – no fix.
  • I have tried adding lines to the wp-config.php file – with no luck Such as

define(‘WP_HOME’,’https://warrenmaginn.com‘);

define(‘WP_SITEURL’,… etc.

define(‘FORCE_SSL_ADMIN’, true);

define(‘FORCE_SSL_LOGIN’, true);

even this solution offered at kinocreative: @define(‘ADMIN_COOKIE_PATH’, ‘/’);

  • when I remove the htaccess file altogether, still no fix (but I do actually get a 404 error page whenever I try access any other page than the root domain, when I dont have the htaccess in place) (which may mean something in the htaccess i needed to correctly link in my site – but my htaccess hasnt changed, and if I edit it down just to the canonical rewrites (I use SSL sitewide, and do not ever use www in any references to my domain (have checked across database etc.)
  • I have tried inserting the text “die(FILE‘:’.LINE);” on every line of the wp-admin/index.php file (to trouble shoot it – and it stopped (without redirecting) even after placing the line all the way at the bottom of the file – so I imagine this means the issue is not in this file)
  • Any other files I should try this in?
  • Or debug modes I can use track this down?

Any suggestions would be VERY appreciated (this is doing my head in)

Thanks in advance for offering your wisdom…

Leave a Comment