免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2430 | 回复: 4
打印 上一主题 下一主题

[Web] 问一个rewrite的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-17 16:45 |只看该作者 |倒序浏览
RewriteEngine On
        RewriteRul       (.*)    /web/$1


      我通过rewriteLog查询,发现并不是这句运行一次就结束。比如 请求/bbs.php  变成了/web/bbs.php  这个时候其实已经得到答案,但还会继续INTERNAL REDIRECT ,又开始了新一论的RewriteRule.这样显然进入死循环。

     1,是这么执行的吗?一定要自己来避免循环吗?还是可以什么地方配置.请大家说说看.
       2.我发现我的环境里 $1不包含 / 字符,这跟手册似乎不一样,你们呢。Server version: Apache/2.2.8 (Unix)



   日志如下
   192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826de20/initial] (3) [perdir /www/jiguang/] strip per-dir prefix: /www/jiguang/bbs.php -> bbs.php
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826de20/initial] (3) [perdir /www/jiguang/] applying pattern '.*' to uri 'bbs.php'
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826de20/initial] (2) [perdir /www/jiguang/] rewrite 'bbs.php' -> '/web/bbs.php'
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826de20/initial] (1) [perdir /www/jiguang/] internal redirect with /web/bbs.php [INTERNAL REDIRECT]
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826fb90/initial/redir#1] (3) [perdir /www/jiguang/] add path info postfix: /www/jiguang/web -> /www/jiguang/web/bbs.php
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826fb90/initial/redir#1] (3) [perdir /www/jiguang/] strip per-dir prefix: /www/jiguang/web/bbs.php -> web/bbs.php
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826fb90/initial/redir#1] (3) [perdir /www/jiguang/] applying pattern '.*' to uri 'web/bbs.php'
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826fb90/initial/redir#1] (2) [perdir /www/jiguang/] rewrite 'web/bbs.php' -> '/web/web/bbs.php'
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#826fb90/initial/redir#1] (1) [perdir /www/jiguang/] internal redirect with /web/web/bbs.php [INTERNAL REDIRECT]
.......
......
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#827f288/initial/redir#10] (3) [perdir /www/jiguang/] add path info postfix: /www/jiguang/web -> /www/jiguang/web/web/web/web/web/web/web/web/web/web/bbs.php
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#827f288/initial/redir#10] (3) [perdir /www/jiguang/] strip per-dir prefix: /www/jiguang/web/web/web/web/web/web/web/web/web/web/bbs.php -> web/web/web/web/web/web/web/web/web/web/bbs.php
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#827f288/initial/redir#10] (3) [perdir /www/jiguang/] applying pattern '.*' to uri 'web/web/web/web/web/web/web/web/web/web/bbs.php'
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#827f288/initial/redir#10] (2) [perdir /www/jiguang/] rewrite 'web/web/web/web/web/web/web/web/web/web/bbs.php' -> '/web/web/web/web/web/web/web/web/web/web/web/bbs.php'
192.168.2.75 - - [17/Apr/2008:16:39:53 +0500] [192.168.2.121/sid#80c3678][rid#827f288/initial/redir#10] (1) [perdir /www/jiguang/] internal redirect with /web/web/web/web/web/web/web/web/web/web/web/bbs.php [INTERNAL REDIRECT]

论坛徽章:
0
2 [报告]
发表于 2008-04-17 17:31 |只看该作者
大家帮帮忙啊.

论坛徽章:
0
3 [报告]
发表于 2008-04-18 09:30 |只看该作者
[L]  表示不执行下面的RewriteRule,现在后面没有了。要[L]干什么呢。而且实际上不行的.

论坛徽章:
0
4 [报告]
发表于 2008-04-18 09:43 |只看该作者
请大家帮忙看看啊

论坛徽章:
0
5 [报告]
发表于 2008-04-21 00:11 |只看该作者
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP