I can’t access wp-admin at all after changing wp-config folder permission for hardening my security. The content for the site load find, I cant access wp-admin at all, all I get is 404 message.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Delete .htaccess
type in domain.com/wp-login.php
login.
Dashboard -> Settings -> Permalinks -> Save. (just automatically recreates your .htaccess again).
If the problem persists. Try disabling plugins. Enable plugins 1 by 1 until the problem occurs again. That will narrow down the faulty plugin.
Method 2
If ALL you did was to change wp-config.php permissions, look on your folder (or on a fresh WP folder) for wp-config-sample.php, make a copy of it, and fill in the database connection lines again.
Then rename wp-config to wp-config-OLD.php and the copy of wp-config-sample to wp-config.php and you should be fine.
Method 3
Don’t delete .htaccess as it may include changes by other plugins like cache creators – at least copy it to .htaccess_bak
It should not be necessary to delete it.
go to yourdomain.com/wp-login.php and login. This should work.
Now rebuild the permalinks: Settings -> Permalinks -> Save
Log out and try again with yourdomain.com/wp-admin
I have to do this every second months, god knows why
Method 4
We had this issue today on a few of our sites & the problem for us was caused by the NGINX caching that we set up on our servers yesterday.
Clearing the NGINX cache resolved this issue for us, hopefully this saves someone else a couple of hours in the future.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0