我正试图获得一堆重写条件来进行评估:
(A and B) or (C and D)
以下是我尝试的格式:
RewriteCond A
RewriteCond B [OR]
RewriteCond C
RewriteCond D
但是,由于OR
具有更高的优先级,因此评估为
A and (B or C) and D
是否可以将上述内容分组?
答案 0 :(得分:3)
您可以使用临时环境变量:
RewriteCond A
RewriteCond B
RewriteRule ^ - [E=PART1:TRUE]
RewriteCond C
RewriteCond D
RewriteRule ^ - [E=PART2:TRUE]
RewriteCond %{ENV:PART1} =TRUE [OR]
RewriteCond %{ENV:PART2} =TRUE
RewriteRule ...