A few days ago, I did not know how to perform operations on the server where wordpress is located. When I updated it today, all the menus in the background experienced error 404. This is because files are lost on the server. But I log on to the server and view all the background files. A few more links found that the wp-admin directory is not automatically added to the URL, so Error 404 is reported.
In retrospect, it seems that I changed the base of the head, but I found it in the code and I didn't find any difference. Compared with the back-end head of another wordpess station, no problem was found.
1. Check the website. htaccess file
Log on to FTP and find. htaccess file to see if any code is found to be redundant and code in a specific area is disabled. If there is any code redundant, delete it. This is the built-in standard wp template. the htaccess file only contains the following code:
# BEGIN WordPress
RewriteEngine On
RewriteBase/
RewriteRule ^ index \. php $-[L]
RewriteCond % {REQUEST_FILENAME }! -F
RewriteCond % {REQUEST_FILENAME }! -D
RewriteRule./index. php [L]
# END WordPress
File permissions in the wordpress installation directory
If the problem persists after checking the plug-in, check the permission of the installation directory as follows:
1) log on to FTP and go to/public_html/wp-admin.
2) right-click the wp-admin folder and edit the File attribute File Attributes.
3) change the folder permission to 755 and apply it to all subdirectories at the same time.
4) click OK. At the same time, set the wp-content and wp-uplodes folders as above.
5) clear cache such as browser cookies.
This is strange. I checked the problem on the Internet and said it was caused by nginx software url rewriting. So I tested it a few more times and finally changed it.
The rewrite rule is modified. Remove the previous rules and change the rewrite rules of wordpress under nginx:
Location /{
Index index.html index. php;
If (-f $ request_filename ){
Break;
}
If (! -E $ request_filename ){
Rewrite./index. php last;
}
}
I don't know whether I changed the head or the server environment caused this problem. This solution solved the problem. This rewrite rule should be the most common. Add to favorites and share it with others.