https://bz.apache.org/bugzilla/show_bug.cgi?id=63051

            Bug ID: 63051
           Summary: RewriteRule in <if> section ignored (using multiple
                    <if> sections)
           Product: Apache httpd-2
           Version: 2.4.37
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: All
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

When I place RewriteRule statements in different <if> sections that get
executed for a particular request, I would expect that all RewriteRule
statements contained in those <if> sections get executed too. However, it seems
that this is not the case, apparently only the RewriteRule statements in one of
the <if> sections are executed, the others are ignored.

Here's a simple example:

<If "true">
  RewriteRule aaa http://somehost/xxx? [R]  # This rule is ignored
</If>
<If "true">
  RewriteRule bbb http://somehost/yyy? [R]  # This rule is applied
</If>

I would expect all requests containing "aaa" to be redirected to
"http://somehost/xxx"; and all requests containing "bbb" to
"http://somehost/yyy";.
However, only the "bbb" redirection rule works , the "aaa" rule is ignored.

Placing the RewriteRule statemens outside of any <if> section works fine.
Having only a single <if> section that contains both RewriteRule statements
works fine. 
Using "RedirectMatch" instead of "RewriteRule" works fine, like so:

<If "true">
  RedirectMatch aaa http://somehost/xxx?
</If>
<If "true">
  RedirectMatch bbb http://somehost/yyy?
</If>


How come it works with "RedirectMatch" but not with "RewriteRule"?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to