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" <[EMAIL PROTECTED]> 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://[EMAIL PROTECTED]'$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));