in reply to Speeding up Apache RewriteMap script.

I agree with merlyn, but if for some reason you are stuck with this approach, then the most obvious optimisation that stares back at me would be to put configuration values as assignments in httpd.conf (loaded once per server startup) instead of having a full cycle of file i/o to read that separate config file occurring once per rewrite.

^M Free your mind!