WordPress后台任意设置项出现404的问题的解决办法

/ 0评 / 0

最近新搞了个站,用的wordpress,后台选项随便点一个老是404,先我以为是缓存问题,刷新之后也没用,仔细看了404页面的网址,域名后都少个“/wp-admin”,找到问题就好解决了

 

打开网站nginx管理conf文件,server {}中间添加规则:

location /wp-admin {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

 

重启nginx,再到后台试试,404问题已解决!

Leave a Reply

Your email address will not be published. Required fields are marked *