So the site was working fine just last week. Today I tried to access the wp-admin page to log in and after slow loading, for a bit, I get an error saying it was redirecting too many times and failed. After lots of research, I tried every method the other articles suggested but nothing worked.
Here is what I tried:
Cleared out my cookies, and cache
Tried other laptops & phones
Used a VPN to see if it was my ISP somehow
Disabled all plugins by renaming the plugins folder
Disabled the theme by renaming the themes folder
Deleted
.htaccess
file but all that did was cause thewp-admin
page to display a403 Forbidden page
. After loading the normal site (aka: mysite.com) the.htaccess
got regenerated and I was back at square one.Added this code to wp-config.php as per this link https://wordpress.stackexchange.com/questions/302965/too-many-redirects-only-when-trying-to-access-wp-admin-page (Tried at the top of the file and the end).
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) $_SERVER['HTTPS']='on';
Tried to define
WP_HOME
andWP_SITEURL
inwp-config.php
None of the above worked and none fixed it. Please note only the wp-admin page has this issue. The site itself loads but I can't access the admin page which is a disaster and I don't know what to do. I hope one of you can help me. Thanks!
CodePudding user response:
For anyone who might be facing this issue, the culprit was the .htaccess
file under the wp-admin
folder. It had a Deny from all written in it which blocked access to everything. Not sure what added it since I definitely did not. When I changed it to Allow from all it worked fine.