vps交流

[nginx] 宝塔装有wp,在二级目录装DZ论坛 如何同时伪静态


用的宝塔
wordpress 安装在根目录www.xxx.com
目前在用的伪静态规则

  1. location /
  2. {
  3.          try_files $uri $uri/ /index.php?$args;
  4. }
  5. rewrite /wp-admin$ $scheme://$host$uri/ permanent;

复制代码

discuz安装在www.xxx.com/bbs
伪静态规则

  1. location / {
  2.         rewrite ^([^.]*)/topic-(.+).html$ $1/portal.php?mod=topic&topic=$2 last;
  3.         rewrite ^([^.]*)/article-([0-9]+)-([0-9]+).html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
  4.         rewrite ^([^.]*)/forum-(w+)-([0-9]+).html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
  5.         rewrite ^([^.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
  6.         rewrite ^([^.]*)/group-([0-9]+)-([0-9]+).html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
  7.         rewrite ^([^.]*)/space-(username|uid)-(.+).html$ $1/home.php?mod=space&$2=$3 last;
  8.         rewrite ^([^.]*)/blog-([0-9]+)-([0-9]+).html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
  9.         rewrite ^([^.]*)/(fid|tid)-([0-9]+).html$ $1/index.php?action=$2&value=$3 last;
  10.         rewrite ^([^.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_-]+).html$ $1/plugin.php?id=$2:$3 last;
  11.         if (!-e $request_filename) {
  12.                         return 404;
  13.         }
  14. }

复制代码

想问下各位大佬,怎么设置才能同时支持WP和DZ同时的伪静态规则

没大佬 能帮忙解答下嘛
直接解析一个bbs.xxx.com  到一个新目录,把DZ移过去不就行了
为什么要这么节省。直接新建个网站就好了。
我开始也放在二级后来发现很麻烦,我直接起了个新域名,