ngnix wp后台 post 404 伪静态

网上流传的这个ngnix伪静态规则是有一些问题的,后台少了wp-admin目录,会显示404





location / {
        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;
         }
}
location / {
        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;

用下面这个就ok了

分享到:
赞(0)

评论抢沙发

评论前必须登录!

全站资源随意下载!

知识无价