httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnold Daniels <>
Subject mod_rewrite XML RewriteMap
Date Fri, 29 Dec 2006 20:58:06 GMT

I use mod_rewrite quite often. The thing I really miss is the option for 
an XML based RewriteMap, where an XPath statement can be used as key. 
Luckily Apache is open-source, so I've edited mod_rewrite to include 
this feature.

It works as follows:
  RewriteEngine On
  RewriteMap xmlmenu xml:/var/www/develop/cfg/menu.xml
  RewriteRule ^/menu/([^/]+)/?$ ${xmlmenu://item[@id='$1']/@page} [QSA]

I was wondering if this feature might be something for the general 
distribution. The XPath statement is performed by libxml2, so 
mod_rewrite needs to be build with -lxml2. Since apache normally isn't 
build against libxml2, perhaps it could be a optional feature with an 
ifdef or something.

I've supplied 2 patches. Both are diff-ed against version 2.0.59 of the 
httpd server (not SVN sorry).

Any comments are welcome.

Thank you and best regards,
Arnold Daniels

View raw message