You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2021/06/21 15:36:43 UTC

[Bug 65393] New: Bug with Apache processing inside `.htaccess`

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

            Bug ID: 65393
           Summary: Bug with Apache processing <If> inside `.htaccess`
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: All
          Assignee: bugs@httpd.apache.org
          Reporter: gilperon@gmail.com
  Target Milestone: ---

I have a ".htaccess" with only this simple code, which sets a header XXXX based
on some conditions:


<If "(%{REQUEST_URI} =~ m#^.*$#)">

    <If "(%{REQUEST_URI} =~ m#^/temp/.*$#)">
    Header set XXXX "BBB2"
    </If>

</If>

<If "(%{REQUEST_URI} =~ m#^/temp/.*$#)">
Header set XXXX "CCC3"
</If>


When I access any file inside "temp" directory the XXXX header is being set to
BBB2 instead of CCC3. This "bug" only happens with nested <If>, if I remove the
nested above, everything works fine, I mean, the XXXX header is set to CCC3.

After searching a lot on Google, it's pretty clear that each Apache module has
its own way of processing rules, in some modules the order in the .htaccess
file does not matter and in other modules, the order does matter. However, in
the case above I see no explanation for what is going on!

NOTE (1): http -v shows the most recent stable Apache version.

NOTE (2): I know I could use && in the first <If> but my actual code is much
more complicated than the one I provided above, so I really needed the nested
<If>.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org