httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnold Daniels <i...@adaniels.nl>
Subject Re: mod_rewrite XML RewriteMap
Date Sun, 31 Dec 2006 14:56:33 GMT
Hi,

I was already looking for a way to put this in a separate module, but I 
didn't find it. Are additional rewrite functions also available in 
version 2.0 or is this introduced in v2.2? Anyway I'll look into it and 
try to come with a new module which does this.

Thanks for you comments.

Best regards,
Arnold


Akins, Brian schreef:
> On 12/29/06 3:58 PM, "Arnold Daniels" <info@adaniels.nl> 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
> works).
>
> -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));
>
>
>
>
>   

Mime
View raw message