xcabove 发表于 2011-8-24 15:09:33

burst vps安装了lnmp情况下实现discuzX2.0伪静态最简便方法

方法是:拿discuzX2管理后台的规则随便建个如discuzx.conf放在/usr/local/nginx/conf/,然后在在usr/local/nginx/conf找到nginx.conf,在里面的server部分的root/home/wwwroot;下面加 include discuzx.conf;。然后删除你的虚拟主机重建。就可以了。

[ 本帖最后由 xcabove 于 2011-8-24 17:32 编辑 ]

licess 发表于 2011-8-24 15:15:51

伪静态必须用dx2的nginx伪静态,贴上配置和伪静态内容看看

xcabove 发表于 2011-8-24 15:23:39

Nginx Web Server

配置规则如下:

rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$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 ^([^\.]*)/(fid|tid)-(+)\.html$ $1/index.php?action=$2&value=$3 last;
if (!-e $request_filename) {
return 404;
}


放在设置虚拟主机的时候,新增的other.conf规则里面,怎么不见有效呢。

licess 发表于 2011-8-24 15:31:29

重启nginx了没?

xcabove 发表于 2011-8-24 15:45:20

重启了/root/lnmp restartnginx -s reload 等命令都试了。就是不知道用子目录建论坛,是不是必须要在vps上建虚拟主机。如果建虚拟主机,并绑定一个新域名,要在哪里把规则加进去。

licess 发表于 2011-8-24 16:58:52

上面的伪静态只适合用的虚拟主机根目录,二级目录不能使用。

xcabove 发表于 2011-8-24 17:05:23

二级目录实现伪静态要怎么办呢?

xcabove 发表于 2011-8-24 17:12:44

已经搞定了,拿上面的规则随便填个如discuzx.conf,然后在在root/usr/local/nginx/conf找到nginx.conf,在里面的root/home/wwwroot;下面加 include discuzx.conf。然后删除你的虚拟主机重建。就可以了。

ouchunlai 发表于 2012-3-4 22:38:22

原帖由 xcabove 于 2011-8-24 17:12 发表 https://bbs.vpser.net/images/common/back.gif
已经搞定了,拿上面的规则随便填个如discuzx.conf,然后在在root/usr/local/nginx/conf找到nginx.conf,在里面的root/home/wwwroot;下面加 include discuzx.conf。然后删除你的虚拟主机重建。就可以了。 ...


一定要重建?这部麻烦吗?有没有什么办法不用重建?
页: [1]
查看完整版本: burst vps安装了lnmp情况下实现discuzX2.0伪静态最简便方法