https://issues.apache.org/bugzilla/show_bug.cgi?id=57337

            Bug ID: 57337
           Summary: Content negotiation fails with conditional Redirect
           Product: Apache httpd-2
           Version: 2.4.10
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_negotiation
          Assignee: [email protected]
          Reporter: [email protected]

When there is a conditional redirect in a vhost, Multiviews/negotiation does
not work anymore.

Steps to reproduce this bug; use this config:

-=-=-=-=-=-
DocumentRoot /var/www
<Directory /var/www/>
    Options MultiViews
    MultiviewsMatch Any
</Directory>
<Virtualhost *:80>
    ServerName foo
    <If "req('X-FOO-BAR') != '1'">
        Redirect permanent / http://apache.org/
    </If>
</Virtualhost>
<Virtualhost *:80>
    ServerName bar
</Virtualhost>
-=-=-=-=-=-
Create a file in /var/www. Content doesn't matter, i used test.html

Request the file:
wget http://bar/test -> HTTP/1.1 200 OK
wget http://foo/test -> HTTP/1.1 404 Not Found (Expected: HTTP/1.1 301 Moved
Permanently)
wget http://foo/test --header "X-FOO-BAR: 1" -> HTTP/1.1 404 Not Found
(Expected HTTP/1.1 200 OK)

In the logs:
==> /var/log/apache2/other_vhosts_access.log <==
bar:80 172.17.42.1 - - [10/Dec/2014:12:48:01 +0000] "GET /test HTTP/1.1" 200
377 "-" "Wget/1.15 (linux-gnu)"
foo:80 172.17.42.1 - - [10/Dec/2014:12:48:02 +0000] "GET /test HTTP/1.1" 404
486 "-" "Wget/1.15 (linux-gnu)"
foo:80 172.17.42.1 - - [10/Dec/2014:12:54:05 +0000] "GET /test HTTP/1.1" 404
486 "-" "Wget/1.15 (linux-gnu)"

==> /var/log/apache2/error.log <==
[Wed Dec 10 12:48:02.859625 2014] [negotiation:error] [pid 48:tid
140525715056384] [client 172.17.42.1:41853] AH00687: Negotiation: discovered
file(s) matching request: /var/www/test (None could be negotiated).
[Wed Dec 10 12:54:05.512771 2014] [negotiation:error] [pid 49:tid
140075132299008] [client 172.17.42.1:39714] AH00687: Negotiation: discovered
file(s) matching request: /var/www/test (None could be negotiated).

A Redirect without the <If> works. Something else besides a Redirect in the
<If> works (using Header for example works and sets a header). However the
Redirect in combination with the <If> fails.

-- 
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