perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>
Subject mod_perl - Intercepting an external Redirect
Date Wed, 19 Sep 2007 14:18:05 GMT
Hi.

I am new to mod_perl apache2 api and hope you can help me a little bit.

I've got following scenario:

A incoming request A is rewritten by apaches rewrite modul to be served by 
mod_proxy_ajp - which is connected to a tomcat.
The servlet there produce the response and this one will passed back to the 
client.
In my case i need to intercept these response from mod_proxy and check if the 
response is a "redirect, code3xx" and the url got some prefix, say /extern.

In this case i want to do a $r->internal_redirect which than would be handled 
again by the rewrite modul, which does a proxy request to another server X, 
which delivers the content.

So in short, i need to analyze the response of mod_proxy and if it matches 
some criteria, i want to do a internal redirect and serve some content under 
the requested url.
The client should not see the "external redirect" the servlet triggers.

I hope i can do this with a ResponseHandler, but as i am new to this stuff, i 
don't know if this is the "right" way.
Using the Handler and telling the rewritemodul to do the proxyrequest does 
result in the answer of the proxy modul, my handler seems to be ignored.

Does someone got this scenario already? How can it be handled best?
Any hints are welcome.

thx

Torsten

Mime
View raw message