需要在站点配置文件中添加wordpress伪静态规则:
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;
}
}
然后重启nginx;
后台在设置/固定链接设置添加自定义链接规则即可,例如:
http://a.com/%year%/%monthnum%/%postname%.html