WordPress nginx固定链接404错误

nginx相关配置中加入以下配置即可:

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;

分享到:更多 ()