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

           Summary: Non-redirect RewriteRule not working with
                    VirtualDocumentRoot
           Product: Apache httpd-2
           Version: 2.2.3
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_rewrite
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Using RewriteRule in virtualhost with VirtualDocumentRoot causes File Not Found
error on url that matches that rule.

I have 2 vhosts blocks - for trunk and for branches. Conf:

-- conf start --
<VirtualHost *:80>
    ServerName example.com

    DocumentRoot /srv/www/trunk

    RewriteEngine On
    RewriteRule ^/a/_(.+)$ /a/rew-$1
</VirtualHost>

<VirtualHost *:80>
    # get the server name from the Host: header
    UseCanonicalName Off

    ServerAlias *.example.com

    VirtualDocumentRoot /srv/www/branches/%1

    RewriteEngine On
    RewriteRule ^/a/_(.+)$ /a/rew-$1
</VirtualHost>
-- conf end --

Expected Results:
http://foo.example.com/a/_foo.txt maps to http://foo.example.com/a/rew-foo.txt

Actual Result:
404 File Not Found


BUT!

This works (not using VirtualDocumentRoot):
http://example.com/a/_foo.txt maps to http://example.com/a/rew-foo.txt

This also works (change in 2nd vhost block):
...
RewriteRule ^/a/_(.+)$ /a/rew-$1 [R]
...
http://example.com/a/_foo.txt is redirected to http://example.com/a/rew-foo.txt


Platform:
$ cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 2

$ uname -a
Linux XXX 2.6.27.45-0.1-xen #1 SMP Tue May 11 15:36:17 EEST 2010 x86_64 x86_64
x86_64 GNU/Linux

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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