开发者社区> 问答> 正文

linuxnginx下,wordpressDiscuz伪静态如何共存?

系统是:linux nginx(阿里的一键安装)
根目录:wordpress
二级目录:Discuz!
问题:
wordpress开启伪静态,Discuz!也开启伪静态,Discuz!报404错误。


应该是伪静态冲突!


如何调整伪静态??????????????
具体方法? ????????? ?????????

展开
收起
allyess 2013-06-14 10:54:06 11846 0
4 条回答
写回答
取消 提交回答
  • Relinuxnginx下,wordpressDiscuz伪静态如何共存?
    学习中!
    2013-06-14 15:05:25
    赞同 展开评论 打赏
  • Relinuxnginx下,wordpressDiscuz伪静态如何共存?
    location / {
        rewrite ^([^\.]*)/topic-(. )\.html$ $1/portal.php?mod=topic&topic=$2 last;
        rewrite ^([^\.]*)/article-([0-9] )-([0-9] )\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
        rewrite ^([^\.]*)/forum-(\w )-([0-9] )\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
        rewrite ^([^\.]*)/thread-([0-9] )-([0-9] )-([0-9] )\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page=$4&page=$3 last;
        rewrite ^([^\.]*)/group-([0-9] )-([0-9] )\.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 ^([^\.]*)/([a-z] )-(. )\.html$ $1/$2.php?rewrite=$3 last;
        if (!-e $request_filename) {
            return 404;
        }
    }
    2013-06-14 13:59:43
    赞同 展开评论 打赏
  • Relinuxnginx下,wordpressDiscuz伪静态如何共存?
    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;
        }
    }
    ----------------------------------
    Discuz!的规则为
    rewrite ^([^\.]*)/topic-(. )\.html$ $1/portal.php?mod=topic&topic=$2 last;rewrite ^([^\.]*)/article-([0-9] )-([0-9] )\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;rewrite ^([^\.]*)/forum-(\w )-([0-9] )\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;rewrite ^([^\.]*)/thread-([0-9] )-([0-9] )-([0-9] )\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page=$4&page=$3 last;rewrite ^([^\.]*)/group-([0-9] )-([0-9] )\.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-([0-9] )-([0-9] )\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;rewrite ^([^\.]*)/(fid|tid)-([0-9] )\.html$ $1/index.php?action=$2&value=$3 last;rewrite ^([^\.]*)/([a-z] [a-z0-9_]*)-([a-z0-9_\-] )\.html$ $1/plugin.php?id=$2:$3 last;if (!-e $request_filename) {return 404;}



    -------------------------

    Relinuxnginx下,wordpressDiscuz伪静态如何共存?
    没人知道?????

    -------------------------

    Relinuxnginx下,wordpressDiscuz伪静态如何共存?
    谢谢,招人解决了
    2013-06-14 11:16:06
    赞同 展开评论 打赏
  • 看下伪静态规则
    2013-06-14 11:09:25
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载