A 404 error occurs in the WordPress backend under nginx environment. How to solve it?

888u

Last update at :2023-12-26,Edit by888u

I have been using AMH4.2 for some time, and a 404 error occurred when logging into the backend after setting up pseudo-static. The solution is: AMH-wordpress Pseudo-static entry into the backend 404 error solution for reference. However, not every webmaster friend uses the AMH control panel, so what should I do if a 404 error occurs? The following methods are for reference only and may not solve your problem. After all, everyone's configuration plan may be different. In the nginx environment, a 404 error will appear in the WordPress blog background. In fact, this is mainly due to the lack of a / in the URL address. There are two ways to solve this problem:
The first method:
Add the following code at the beginning of the WordPress configuration file wp-config.php:

Note: This code should be added before the php tag.
The second method:
If you are using the environment installed by the LNMP one-click installation package, the website configuration file will include the static configuration file of wordpress

 include wordpress.conf;

At this time we only need to add the following code at the end of the wordpress.conf static configuration file:

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

Just restart nginx.

Recommended site searches: Ministry of Industry and Information Technology registration query, free international domain name, US attack defense server, US virtual host, foreign domain name, website registration information query, Hong Kong server defense, registration number query, domain name information query, Chinese international domain name,

p>

A 404 error occurs in the WordPress backend under nginx environment. How to solve it?

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码