rewritecond $1的疑惑
我看ci的.htaccess中, rewritecond $1!^(index\.php|, 有些疑惑,这个$1代表的是什么呢?是rewriterule中的 ^(.*)$ 这里的(.*)吗? 看起来应该是的,但如果是的话,我记得正则表达式不是只有后向引用吗? 怎么rewritecond就可以引用rewriterule里的分组了呢?这还是后向引用吗? SORRY,找到答案了:Regex Back-Reference AvailabilityOne 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.
页:
[1]