HainaTec 发表于 2018-3-26 10:41:25

discuz X3.4 Nginx伪静态固规则

很多客户升级到3.4版本之后访问新闻页面时出现了“插件不存在或已关闭”的情况,原因是伪静态规则导致的!给大家分享一个3.4版本正在使用的Nginx伪静态规则,希望能够帮助大家!


location / {
        rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
        rewrite ^([^\.]*)/article-(+)\.html$ $1/portal.php?mod=view&aid=$2 last;
        rewrite ^([^\.]*)/forum-(\w+)-(+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
        rewrite ^([^\.]*)/thread-(+)-(+)-(+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
        rewrite ^([^\.]*)/group-(+)-(+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
        rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
        rewrite ^([^\.]*)/blog-(+)-(+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
        rewrite ^([^\.]*)/(fid|tid)-(+)\.html$ $1/index.php?action=$2&value=$3 last;
        rewrite ^([^\.]*)/(+*)-(+)\.html$ $1/plugin.php?id=$2:$3 last;
        if (!-e $request_filename) {
                        return 404;
        }
}

页: [1]
查看完整版本: discuz X3.4 Nginx伪静态固规则