wp-admin not working: wp-login.php redirects to wp-admin%2F&reauth=1
This tutorial guides you on how to resolve wp-admin not working: wp-login.php redirects to wp-admin%2F&reauth=1 issue and the error, the request URL /wp-admin/ was not found on the server error.
wp-admin not working: wp-login.php redirects to wp-admin%2F&reauth=1
One fine morning, I was trying to login to wordpress dashboard as I wanted to create/update posts. But I could not login to wordpress wp-admin or dashboard site. And when I tried to access the following URL from browser:
https://www.domain.com/wp-admin
It automatically redirected to the following URL:
https://www.domain.com/wp-login.php?redirect_to=https%3A%2F%2Fdomain.com%2Fwp-admin%2F&reauth=1
And the response I got is as follows:
Not Found The requested URL /wp-admin/ was not found on this server.
Troubleshooting – wp-admin login issue
I tried all the suggestions from internet below:
1: First, I tried clearing cache and cookies both in browser and server side.
2: Then enabled debug mode by adding the following line in wp-config.php file.
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); //to generate debug.log in wp-content folder
But I don’t see any logs that directs me to fix wp-admin login redirect 404 not found problem.
3: Then I tried changing salts, clearing meta_value for session_tokens in wp_usermeta table.
To change salts I have generated new salts using the following link: https://api.wordpress.org/secret-key/1.1/salt/
Then copied them to wp-config.php file.
define('AUTH_KEY', '!Pq Z!dYi_CT66~+xN5d^j#ChBBBi&vz~wwXd51$w-?sZ`4l!.Q0G]r}LGK[C,;x'); define('SECURE_AUTH_KEY', '|+$>JXd-h*v<+jJLw}yVQ7tx7{iiTaw%G3znK0f5||?pJ}f@w1PS+O9Mf}iT^o}|'); define('LOGGED_IN_KEY', '(-e(zBTTI-q=yG?5|M[#i-Edl+KXUY] QR5$h{LN#NW+gYqv0JB~+Y9>4|~bSApW'); define('NONCE_KEY', 'WfVIpIc]ik5?F70|Br1NA1d9<Uj)||!?P9+^mUwx7$dkTB30}hJ)p1I;(8sU:$EN'); define('AUTH_SALT', '[R-?8a$ t!Y.F_5)kB?#4nlUu5o$W]<-&Smo-5;0p/a}h20#E6uo_oTtSHjmm_B3'); define('SECURE_AUTH_SALT', 'Vy|rEjSO.BRflFo(-F|w_ye ;kaE5~N-%nlcQ-G8E3a)[En~M<2%$1KL[y?/-1O '); define('LOGGED_IN_SALT', '(9b[-,Z#:r-7+d237j4,O G#xxElVQb+Y^B_/2b!Ko#hP~7bP8/grHm+AtpRI;3J'); define('NONCE_SALT', '(_BtZ6l^3^E6#X|7Jm5Y:et$}v %,$]~6Ne)ReuPcW5HuP4^_/d=>PMtI(]@1>Tp');
After, that cleared meta_value for session_tokens in wp_usermeta. But none of these fixed my wordpress wp-admin login issue.
4: Also, checked the entries for SITE_URL & HOME in the database. It’s all looking fine.
5: Then, I logged in to FTP and checked the wp-admin folder and wp-login.php all exists and looking fine.
Hitting the following wp-login.php directly also causing same kind of problem: 404 not found
https://www.domain.com/wp-login.php
Response:
Not Found The requested URL /wp-login.php was not found on this server.
6: My .htaccess file is looking fine and it’s not hacked. And files all looking fine nothing was hacked.
7: Note, I did not install anything new in my wordpress site i.e., I did not install any new plugins or themes. But I am not sure what was causing this problem all of a sudden.
Solution:
For me the following solution worked. What I quickly did was tried to login to FTP and renamed the doubtful plugins one by one which might be causing the issue. I had renamed the following plugin “HTTP headers to improve web site security ” and checked if I could login wp-admin dashboard.
Yay! it worked. It was the plugin causing to wp-admin login issue where wp-login.php redirects to wp-admin%2F&reauth=1 and getting response request URL not found on the server.
After that, I did a “FULL SCAN” using Wordfence and it reported me the message saying that the plugin “HTTP headers to improve web site security” need to be removed and status as Critical.
Therefore, I had deactivated and removed that plugin.
Note, this plugin has been deactivated by the creator. Therefore, I would recommend you to remove this plugin as soon as possible to avoid any such issues.
That’s it. The wp-admin login issue is resolved by deleting the problematic plugins. Hope it helped 🙂
- Manually Backup WordPress Site using cPanel – Bluehost & Local Setup ?
- Default .htaccess file for WordPress website ?
- How to configure XAMPP PHP to send mail from localhost ?
- XAMPP browser redirects to localhost/dashboard
- TinyMCE Advanced Editor no longer working – WordPress
- SEO incoming links are not getting displayed in WordPress dashboard
- How to transfer copy of WordPress website to Google Cloud for free
- Convert floating point number to fixed point
- Enable debugging in WordPress website
- Fix “Notice: Undefined variable”, “Notice: Undefined index” and “Warning: Undefined array key” errors in PHP
Thank you. Solved my issue.