DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43128>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43128





------- Additional Comments From [EMAIL PROTECTED]  2007-08-15 13:22 -------
I can not agree that I shouldn't use mod_vhost_alias and mod_rewrite together.

I will try to explain why I would like both features in the same VirtualHost 
and why I think they should be used together.

We are using rewrite rules on PHP sites to simulate user friendly urls. We 
have many developers who are programming the same site maintained by 
subversion. Every programmer checks out the site to her/his home directory. If 
we put "*.hostname IN A x.x.x.x" in the DNS server, every programmer could 
have accessed his copy of the site via http://<username>.hostname.local/ just 
by following the rule to check out the site to proper directoy. 
VirtualDocumentRoot would enable every programmer to see his own copy. Rewrite 
rules would enable every programmer to simulate exactly the same behavior for 
user friendly URLs as on the main site.

Since mod_vhost_alias and mod_rewrite don't work together I have to invent 
some additional rules to simulate VirtualDocumentRoot along with rewrite rules 
which are already present. That way I have to have some very special rewrite 
rules applicable only for development copies and have to take special care 
that rules on the production server will work to. If I could use directives 
from both modules it would be much easier. That does not provide the 
functionality to have the same configuration on development and production 
servers. This is always potential problem for compatibility.

Here is the example of the VirtualHost I was trying to setup. It is IP based 
virtual hosting:
<VirtualHost x.x.x.x>
        VirtualDocumentRoot /home/%1/phpprojects/hostname/
        ServerName hostname
        CookieTracking on

        AddType application/x-httpd-php .php
        CustomLog logs/hostname.local.hal.si-combined_log combined

        RewriteEngine on
        RewriteRule  ^/attachment/ /attachment.php [NC,L]

        RewriteCond %{REQUEST_URI} ^(?!/images/).*               [NC]
        RewriteCond %{REQUEST_URI} ^(?!/img/).*                  [NC]
        RewriteCond %{REQUEST_URI} ^(?!/script/).*               [NC]
        RewriteCond %{REQUEST_URI} ^(?!/rss/).*                  [NC]
        RewriteCond %{QUERY_STRING} (.*)                         [NC]

        RewriteRule ^/(.*?)(/(\d+))?$ /index.php?ID=$3&url=$1&%1 [NC,L]
<VirtualHost>

I also don't think that the bug is the same as bug 26052. The bug 26052 says 
that DOCUMENT_ROOT environment variable was not set. In the case I am talking 
about not just the environment variable but also the document root itself is 
not set properly.

Possible workarounds I see now are to make a VirtualHost for every developer 
on the site with fixed DocumentRoot and rewrite rules as they will be on the 
production site. The second option is to make additional rewrite rules which 
are not going to be applied on the production server. The third option is my 
favorite and that is to use mod_vhost_alias and mod_rewrite together.

I will not change the status to "Reopen bug" because I am not the expert on 
Apache source code and design. I am just the user. After you consider my 
arguments do what ever you are pleased. I know I would be very pleased if I 
could use both modules together and in my case I can't see any reason why they 
shouldn't be. If you discard this bug I will probably take a look at the 
source and change it myself. It will take me much longer as would someone who 
is familiar with the code.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to