Hi,

I came across a strange behavior of mod_rewrite while using with zope.
Although it is not a zope question, I was wondering if any of you have
run into this. We are using mod_rewrite to redirect the users to one of
the zope sites of a Zeo cluster.

The directive RewriteMap has unexpected behavior when it is used to
define more than one map with same map name in diffrent places. Normally
all the directives within a tag applies only to that tag. 

For example:

<VirtualHost *>
ServerName   www.foo.com
DocumentRoot /var/www/foo
RewriteEngine on
RewriteLog    /var/log/httpd/foo.log
RewriteLogLevel  2
RewriteMap map rnd:/etc/httpd/conf/foomap.txt
RewriteRule ^/Foo(.*)
http://127.0.0.1${map:IP}/VirtualHostBase/http/foo/$1 [L,P]
</VirtualHost>

<VirtualHost *>
ServerName   www.bar.com
DocumentRoot /var/www/bar
RewriteEngine on
RewriteLog    /var/log/httpd/bar.log
RewriteLogLevel  2
RewriteMap map rnd:/etc/httpd/conf/barmap.txt
RewriteRule ^/Bar(.*)
http://127.0.0.1${map:IP}/VirtualHostBase/http/bar/$1 [L,P]
</VirtualHost>

The above is expected to work. However ModRewrite, does not read the map
file foomap.txt or barmap.txt everytime it needs it and it caches the
results after the first time it reads for faster operation.  

The problem is the cache treats both the file as the same since they
have the same name! Hence if you visit foo.com first, the data stored in
foomap.txt is returned from the cache next time you visit foo.com or
bar.com. This causes apache to redirect into the wrong zope site.

Has anyone else experienced similar problems ? 

thanks,
ganesh

Zeomega LLC
Open minds' Open Solutions

Plano, Texas, USA
Bangalore, India
phone: 972-731-6750
http://www.zeomega.com

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to