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 12:41:59 GMT
On Thu, Feb 28, 2008 at 8:30 PM, Torsten Foertsch
<torsten.foertsch@gmx.net> wrote:
> On Thu 28 Feb 2008, J. Peng wrote:
>
> > currently I write it with PerlAccessHandler, it also works. is it
>  > right with this handler?
>
>  Do you want to send a redirect to the browser (HTTP code 3xx)?

I use apache's inner redirect rather than the 3xx external redirection.


> If yes then it
>  can be done in an access handler as well. If you simply want to send the
>  document in /pathA or /pathB then I think you'd prefer something *before* the
>  core map_to_storage handler, that means a PerlTransHandler or a
>  PerlMapToStorageHandler since otherwise you'd need to fill out the finfo
>  field by yourself, see
>
>   http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_finfo_
>
>

thanks for the info.

>  > no, mod_rewrite can't rewrite requests based on Accept-Encoding header.
>
>  yes, something like this:
>
>  RewriteCond %{HTTP:Accept-Encoding} gzip [OR]
>  RewriteCond %{HTTP:Accept-Encoding} deflate
>  RewriteRule ^(.*) /pathA/$1 [PT,L]
>
>  RewriteRule ^(.*) /pathB/$1 [PT,L]
>
>  or as an external redirect:
>
>  RewriteCond %{HTTP:Accept-Encoding} gzip [OR]
>  RewriteCond %{HTTP:Accept-Encoding} deflate
>  RewriteRule ^(.*) /pathA/$1 [R,L]
>
>  RewriteRule ^(.*) /pathB/$1 [R,L]
>
>  Why do you think this wouldn't work?
>

I'll try it. thanks so much torsten.

Mime
View raw message