Re: need to write a fitler based on request header

2008-02-28 Thread Torsten Foertsch
On Thu 28 Feb 2008, J. Peng wrote: > Also I checked apache's official document for mod_rewrite: > http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html Well, Apache 2.2 can, see http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond Other things you should be aware of: ... 4. %{HTTP:

Re: need to write a fitler based on request header

2008-02-28 Thread J. Peng
Hello Torsten, I have tested your rewrite syntax like below: RewriteEngine On RewriteCond %{HTTP:Accept-Encoding} gzip [OR] RewriteCond %{HTTP:Accept-Encoding} deflate RewriteRule ^/unzip/(.*) /gziped/$1 [PT,L] Sorry it can't work. Also I checked apache's official document for

Re: need to write a fitler based on request header

2008-02-28 Thread J. Peng
On Thu, Feb 28, 2008 at 8:30 PM, Torsten Foertsch <[EMAIL PROTECTED]> 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

Re: need to write a fitler based on request header

2008-02-28 Thread Torsten Foertsch
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)? If yes then it can be done in an access handler as well. If you simply want to send the document in /pa

Re: need to write a fitler based on request header

2008-02-28 Thread J. Peng
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 <[EMAIL PROTECTED]> wrote: > On Thu 28 Feb 2008, J. Peng wrote: > >

Re: need to write a fitler based on request header

2008-02-28 Thread Torsten Foertsch
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

need to write a fitler based on request header

2008-02-27 Thread J. Peng
Hello members, 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 di