Wasted hours figuring the WordPress login redirect loop now affecting my site. I assumed redirects were screwed up after I moved the WordPress install into its own subdirectory.
Messed with the .htaccess file, trying the out all the directives. Ended up screwing the all sub-links instead. At this time I was only mucking about with the .htaccess file in the root folder. Didn’t work. Copied the settings to the one in the sub-directory. Didn’t do the trick.
Copied the file from my backup, and fooled with it again. No dice.
Deleted the file. Left the one in the root folder untouched. Deleting the file in the sub-directory didn’t work too, but my wordpress files loaded, except for the sub-links of course. Oh well, why not just move the whole damn folder back to where it was, with the original .htaccess file?
THAT.DID.NOT.WORK.
Oh, I forgot, I tried renaming the sub-directory, cause I thought, maybe, “because the folder name was repetitious”. That yielded nothing, just me squinting over several lines of code to make sure I didn’t miss or mis-spelt anything, which I did, in several places. Several times.
So I went back to the original folder (the sub-directory) and deleted both .htaccess files, in the root and sub-folder, and started over again. Writing and re-writing the same things, futilely hoping that a single line would make things work again.
I had other installations too (and they too had the same problem), and I digged into their .htaccess file, and also scoured for clues in wp-config files. Nothing, not a thing worked. Not my browser cookies, not my plugins, not caches on WordPress or browsers. I could get my site to work, actually it did still work, even before I found the problem, but the redirect loop at the admin login was infuriating.
The only way I could get into the admin backend was by right-clicking the link to my site, and refreshing the page (so it wouldn’t redirect) and hopefully, either the right-clicked tab, or the refreshed one would have the backend. I thought that was it.
Having done so much edits to the original .htaccess file, I can’t keep track of it anymore. And in some cases, I keep getting redirected, even in the backend. I could end up on the main page, or found staring at the login page. Moving my WordPress files back to the sub-folder, worked, save for the annoying redirect at the login page. I was tired and annoyed at this point, and close to giving up.
By this time, I’ve found out, if I used http instead of https, it would redirect to

the https with no redirect. A partial solution, but not not a permanent fix. Also, if I logged out, I can use the /wp-login.php?loggedout=true flag to avoid the redirects. So, I might just add a hyperlink to the login page to avoid copy-pasting this flag, or deleting the ‘S’ in https in the address bar to avoid this darned “&reauth=1” flag.
I can’t for the life of me figure out what happened. Did the new WordPress update cause this? Up until yesterday, it was still working, and I’ve shifted my main site into its own folder for a few days already. It worked, then. The other installs I have are also affected, and are a minor version behind (6.1 as opposed to 6.1.1). This is a problem for tomorrow, I need to sleep.
Update
A year later, I think this is due to salts and security keys being mixed up when I swapped out the wp-config.php file. I might find some time to sort this out over the coming days. It IS the salts and security keys. Click here to regenerate a new one.
https://ithemes.com/blog/wordpress-login-redirect-loop/
Be First to Comment