httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joachim Zobel <jzo...@heute-morgen.de>
Subject Re: rewriting request uri in a request handler
Date Mon, 29 Oct 2007 07:11:47 GMT
Am Mittwoch, den 24.10.2007, 11:55 +0200 schrieb Holger Moser:
> I have a question regarding request uri rewriting in an
> request_handler,
> right now i do this by overwriting the "request_rec->uri" element
> which
> works but leads to a second
> call of my request handler (it seems that apache recognizes the change
> and fires a new request with the rewritten uri) 

This is because the fact that you are in a request handler means that
URL translation has already been done. If you change the URI, it needs
to be redone including all subsequent phases like authentication.

> which wouldnt be a
> problem if i could distinguish if its a request from a rewrite or a
> "normal" one (and skip the handler if its a rewritten).

The request can be distiguished. The second request is what is called an
internal redirect (and a subrequest) and there are ways to detect this.
I have only done this from mod_perl, there are $r->prev and the like. I
would however recommend using Joe Lewis proposal, since you may want
your module to be usable in internal redirects in the future. However I
am not 100% shure if the sub process enviroment survives an internal
redirect.

Sincerely,
Joachim



Mime
View raw message