wordpress是支持这种访问的 https://1024.ee/?p=6767

那么我就想把访问 https://1024.ee/6767.html 自动重写成 https://1024.ee/?p=6767,实现伪静态
只需要在nginx的配置当中写上
# \d 代表数字, + 意思是至少1个以上
rewrite ^/(\d+).html https://1024.ee/?p=$1

测试一下

wordpress是支持这种访问的 https://1024.ee/?p=6767
那么我就想把访问 https://1024.ee/6767.html 自动重写成 https://1024.ee/?p=6767,实现伪静态
只需要在nginx的配置当中写上
# \d 代表数字, + 意思是至少1个以上
rewrite ^/(\d+).html https://1024.ee/?p=$1
测试一下