外头站着
10
10 月

腾讯云宝塔 Nginx 下WordPress 固定链接失效

在宝塔面板里添加一下伪静态即可

如果 WordPress 安装在二级目录下例如 /blog

那么需要用如下代码

location /blog {
    set $need 0;
    if (!-f $request_filename){
        set $need 1;
    }
    if ($request_uri ~* admin){
        set $need 0;
    }
    if ($need = 1) {
        rewrite (.*) /blog/index.php;
    }
    rewrite /blog/wp-admin$ $scheme://$host$uri/ permanent;
}

来源: https://segmentfault.com/a/1190000038434008

yeah, bigCat made it!

» You can leave a comment, or trackback from your own site.

板凳尚存 to “腾讯云宝塔 Nginx 下WordPress 固定链接失效”

  1. 海拉拉说道:

    很有用的配置

Leave a Reply

:!: :roll: :o :lol: :P :( 8O :x :oops: :) :?: :idea: :evil: ;) :twisted: