全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2238|回复: 15
打印 上一主题 下一主题

[疑问] DZ1.5的规则加到那个地方

[复制链接]
跳转到指定楼层
1#
发表于 2010-9-4 10:40:53 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
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%3D$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;
}



是不是加到usr/local/nginx/conf/nginx.conf里面的server里面啊
16#
 楼主| 发表于 2010-9-4 15:24:58 | 只看该作者
15#
 楼主| 发表于 2010-9-4 12:06:43 | 只看该作者
大家帮下我啊
14#
 楼主| 发表于 2010-9-4 11:26:59 | 只看该作者
已经重启了
13#
发表于 2010-9-4 11:26:34 | 只看该作者
重启nginx了么
12#
 楼主| 发表于 2010-9-4 11:22:30 | 只看该作者
还是不行。晕了
11#
发表于 2010-9-4 11:11:03 | 只看该作者
本地新建一个conf文件起 dzx.conf
写入
  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 ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
  9. if (!-e $request_filename) {
  10.         return 404;
  11. }
  12. }
复制代码
传到 usr/local/nginx/conf里
然后回到你的域名的conf里
include dzx.conf;
10#
 楼主| 发表于 2010-9-4 11:06:32 | 只看该作者
原帖由 vaman 于 2010-9-4 11:04 发表
反正我的是行的
我是把规则直接存到vhost那里面直接include调用的


写上你的步骤吧
9#
发表于 2010-9-4 11:04:34 | 只看该作者
反正我的是行的
我是把规则直接存到vhost那里面直接include调用的
8#
 楼主| 发表于 2010-9-4 11:02:46 | 只看该作者
原帖由 vaman 于 2010-9-4 10:59 发表
RewriteEngine On
RewriteBase /
是你自己加的?


是的,我去掉了也是不行的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-12-24 04:41 , Processed in 0.077315 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表