【问题标题】:How to achieve this perticular AND and OR logic in apache rewritecond如何在 apache rewritecond 中实现这种特殊的 AND 和 OR 逻辑
【发布时间】:2013-12-06 02:08:01
【问题描述】:

我想做一个像这样的 Rewritecond:

如果 (A AND B) OR (C AND D) OR (E AND F) 做重写规则

据了解,OR 的优先级高于 AND,所以如果我这样做了

rewritecond A     
rewritecond B [or]
rewritecond C 
rewritecond D [or]
rewritecond E 
rewritecond F
RewriteRule xxxx

它可能会做 A AND (B OR C) AND (D OR E) AND F 相反,这不是我想要的.. 我应该如何实现一阶?

谢谢!!!

/洛林

【问题讨论】:

    标签: apache mod-rewrite


    【解决方案1】:

    这会做你想做的事。你只需要写同样的RewriteRule xxxx 3 次

    RewriteCond A     
    RewriteCond B
    RewriteRule xxxx
    
    RewriteCond C 
    RewriteCond D
    RewriteRule xxxx
    
    RewriteCond E 
    RewriteCond F
    RewriteRule xxxx
    

    【讨论】:

    • m..我试图避免这种情况,因为我有很多类似的事情会导致配置文件中的设置过长。但你是对的,这可能就是这样。谢谢!
    • AFAIK 这是唯一的方法。这个问题纯粹是审美问题(没有人喜欢大的 conf 文件),但 Apache 并不介意
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-29
    • 2010-10-16
    • 2014-05-26
    • 2012-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多