最近有很多大佬找到我说我的内页(尤其文章页)不美观(index.php等)。因此小小修改了内页的固定链接、添加伪静态。
打开网站设置-固定链接

修改固定链接
将固定链接修改为/%post_id%.html

使用WP Permalinks Migration插件
安装插件
这一步将原来的死链重定向至新链接。有很多重定向的方法,在此教使用插件的方法。(如有其他方法请忽略本步骤)
下载链接 密码:9k0b
设置插件
输入原来的固定链接

设置伪静态
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;
}
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
重载Nginx
/usr/local/nginx/sbin/nginx -s reload
刷新一下就好啦~