perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: need to write a fitler based on request header
Date Thu, 28 Feb 2008 11:26:51 GMT
On Thu 28 Feb 2008, J. Peng wrote:
> I need to write an input filter based on the request headers.
> If request includes a "Accept-Encoding: gzip, deflate" header, I
> should redirect the request to /pathA.
> If request doesn't include that header, I should redirect the request to
> /pathB. (pathA and pathB are web document dirs on web server.)

I think you don't need an input filter. What you need is a PerlTransHandler or 
a PerlMapToStorageHandler that checks $r->headers_in->{'Accept-Encoding'} and 
sets $r->filename and/or $r->uri accordingly.

This can even be done with mod_rewrite.

Torsten

Mime
View raw message