主目录安装wordpress 二级目录安装discuz如何配置伪静态?
lnmp1.1环境下,准备在主目录安装wordpress,二级目录安装discuz 3.2,即访问主域名xxx.com 是wordpress博客二级目录:xxx.com/bbs 是discuz 3.2论坛
请问该如何配置伪静态? 自己修改配置文件分别include上2个程序的伪静态就行了,discuzx的伪静态用二级目录的
include wordpress.conf;
include discuzxsub.conf;
discuzxsub.conf放/usr/local/nginx/conf/ 下,内容为discuzx的二级目录的伪静态
设置完成重启 还是不行啊,配置之后论坛可以访问,博客又不能访问了。server
{
listen 80;
server_name xxx.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/xxx.com;
include wordpress.conf;
include discuzxsub.conf;
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
上面是域名conf
下面shidiscuzxsub.conf
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/article-(+)-(+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 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;
}
[ 本帖最后由 robin 于 2014-9-19 16:06 编辑 ]
回复 3# 的帖子
你这个论坛伪静态一看就不是二级目录的伪静态回复 4# 的帖子
换成以下样式也不行,只能访问论坛,不能访问博客rewrite ^([^\.]*)/bbs/topic-(.+)\.html$ $1/bbs/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/bbs/article-(+)-(+)\.html$ $1/bbs/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^([^\.]*)/bbs/forum-(\w+)-(+)\.html$ $1/bbs/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^\.]*)/bbs/thread-(+)-(+)-(+)\.html$ $1/bbs/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^([^\.]*)/bbs/group-(+)-(+)\.html$ $1/bbs/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^\.]*)/bbs/space-(username|uid)-(.+)\.html$ $1/bbs/home.php?mod=space&$2=$3 last;
rewrite ^([^\.]*)/bbs/blog-(+)-(+)\.html$ $1/bbs/home.php?mod=space&uid=$2&do=blog&id=$3 last;
rewrite ^([^\.]*)/bbs/(fid|tid)-(+)\.html$ $1/bbs/index.php?action=$2&value=$3 last;
rewrite ^([^\.]*)/bbs/(+*)-(+)\.html$ $1/bbs/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
return 404;
} location /bbs/ {
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/article-(+)-(+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 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;
}
}
回复 6# 的帖子
现在正常了,谢谢军哥
页:
[1]