# my mod_rerite.conf
# section 1
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} Firefox  [OR]
RewriteCond %{HTTP_USER_AGENT} lwp-request [OR]
RewriteRule ^/mp3/aaa\.mp3$            /mp3/aaa.html

# section 2
RewriteCond %{HTTP_USER_AGENT} MSIE
RewriteRule /fake.html         /mp3/bbb.mp3

# EOF

in section 1
firefox / lwp can only get a html page, and IE or other agent will got the
mp3 and play,

I just add section 2 now, but when I access http://../fake.html  with IE,
windows media-player auto-lanched, but can not play the file, maybe because
the filename is html

lwp,
#HEAD http://192.168.1.2/fake.html <http://192.168.1.217/fake.html>
200 OK
Connection: close
Date: Fri, 07 Dec 2007 01:22:13 GMT
Accept-Ranges: bytes
ETag: "fec34-22bee2-f884a000"
Server: Apache/2.2.4 (Fedora) DAV/2 mod_perl/2.0.3 Perl/v5.8.8
Content-Length: 2277090
Content-Type: audio/mpeg
Last-Modified: Fri, 07 Dec 2007 01:14:40 GMT
Client-Date: Fri, 07 Dec 2007 01:22:13 GMT
Client-Peer: 192.168.1.217:80
Client-Response-Num: 1






2007/12/7, Perrin Harkins <[EMAIL PROTECTED]>:
>
> On Dec 5, 2007 11:15 PM, Silent <[EMAIL PROTECTED]> wrote:
> > I tryed mod_rewrite to redirect base on user_agent, it works very fine!
> > but I still want to know how to do it in mod_perl.
>
> Can you tell us what you did in mod_rewrite?  Then we can show you an
> equivalent for mod_perl.
>
> - Perrin
>

Reply via email to