Double request from mod-rewrite
Posted
by Dave
on Stack Overflow
See other posts from Stack Overflow
or by Dave
Published on 2009-09-22T18:58:59Z
Indexed on
2010/04/02
14:03 UTC
Read the original article
Hit count: 277
apache
|mod-rewrite
I've written a module that sets Apache environment variables to be used by mod-rewrite. It hooks into ap_hook_post_read_request()
and that works fine, but if mod-rewrite matches a RewriteRule then it makes a second call to my request handler with the rewritten URL. This looks like a new request to me in that the environment variables are no longer set and therefore I have to execute my (expensive) code twice for each hit.
What am I doing wrong, or is there a work around for this?
Thanks
© Stack Overflow or respective owner