[Zope-dev] Zope, VirtualHosts, mod_rewrite and you.

ngarcia ngarcia@codeit.com
Tue, 22 Jun 1999 12:42:52 -0700 (PDT)


Here's the situation:

We use VirtualHosts that look like this:

<VirtualHost 127.0.0.1>
RewriteEngine on
RewriteCond %{HTTP:Authorization}  ^(.*)
RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/site1/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
</VirtualHost>

<VirtualHost 127.0.0.2>
RewriteEngine on
RewriteCond %{HTTP:Authorization}  ^(.*)
RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/site2/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
</VirtualHost>

On the surface, everything rewrites fine.  The problem is that for some
reason, the rewrite action gets called twice.  The first time, it rewrites
correctly, and everything looks the way it should.  The second time it
gets called, it sets the PATH_TRANSLATED to
/home/httpd/cgi-bin/Zope.cgi/site1/site1/whatever.html which is causing
some problems.

So basically, my question is this:  Why is the rewrite rule getting called
twice?  The first time it recognizes it as the initial call, and it calls
the second one subreq.  

I have the rewrite log with RewriteLogLevel set to 9 if anyone wants to
see it.

Nick Garcia | ngarcia@codeit.com
CodeIt Computing | http://codeit.com