就在刚刚,boss需要看公司网站后台,网站是用wordpress搭的,发现全是404,蛋疼,于是google,下面是解决办法:

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;

加上这句rewrite /wp-admin$ $scheme://$host$uri/ permanent,然后重启nginx就好了

相关文章:

  • 2021-06-25
  • 2021-04-02
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-06-03
相关资源
相似解决方案