当时环境:宝塔+Nginx

在宝塔伪静态规则添加下面代码无效

location /
{
try_files $uri $uri/ /index.php?$args;
}

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

下面替换为

location /二级目录名称/ {

index index.html index.php;

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;

}

}

完美解决

参考文章

 

https://blog.csdn.net/sunsineq/article/details/111057690

https://blog.csdn.net/qq_35787254/article/details/120540692

https://blog.csdn.net/weixin_33772645/article/details/85881387