perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Peng" <peng....@gmail.com>
Subject Re: need to write a fitler based on request header
Date Thu, 28 Feb 2008 11:35:59 GMT
thanks torsten.
currently I write it with PerlAccessHandler, it also works. is it
right with this handler?
no, mod_rewrite can't rewrite requests based on Accept-Encoding header.

On Thu, Feb 28, 2008 at 7:26 PM, Torsten Foertsch
<torsten.foertsch@gmx.net> wrote:
> 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