httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akins, Brian" <>
Subject Re: mod_rewrite XML RewriteMap
Date Sat, 30 Dec 2006 19:09:52 GMT

On 12/29/06 3:58 PM, "Arnold Daniels" <> wrote:

> 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]

Can't this be done via a rewrite function (not very well documented, but it

-1 doing this in mod_rewrite.  Needs to be in a mod_xml_rewrite (or whatever
name) and use the rewrite function interface.

>From mod_rewrite.h (2.2.3)

/* rewrite map function prototype */
typedef char *(rewrite_mapfunc_t)(request_rec *r, char *key);

/* optional function declaration */
APR_DECLARE_OPTIONAL_FN(void, ap_register_rewrite_mapfunc,
                        (char *name, rewrite_mapfunc_t *func));

Brian Akins
Chief Operations Engineer
Turner Digital Media Technologies

View raw message