用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2581|回复: 1
收起左侧

[HELP] rewritecond $1的疑惑

[复制链接]
发表于 2011-11-17 01:16:34 | 显示全部楼层 |阅读模式
我看ci的.htaccess中, rewritecond $1!^(index\.php|, 有些疑惑,这个$1代表的是什么呢?是rewriterule中的 ^(.*)$ 这里的(.*)吗? 看起来应该是的,但如果是的话,我记得正则表达式不是只有后向引用吗? 怎么rewritecond就可以引用rewriterule里的分组了呢?这还是后向引用吗?
 楼主| 发表于 2011-11-17 01:35:31 | 显示全部楼层
SORRY,找到答案了:Regex Back-Reference Availability

One important thing here has to be remembered: Whenever you use parentheses in Pattern or in one of the CondPattern, back-references are internally created which can be used with the strings $N and %N (see below). These are available for creating the strings Substitution and TestString. Figure 1 shows to which locations the back-references are transferred for expansion as well as illustrating the flow of the RewriteRule, RewriteCond matching.

本版积分规则