mod_perl and mod_rewrite can work together ?

Idel Fuschini <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CANLPD3o6aACWqj8LQx0pwgjNPz9VKO7aqga2H0L6oJtJEQomBw@mail.gmail.com>
I've got this issue, in httpd.conf:

PerlTransHandler +Apache2::MyRedirect
RewriteRule ^/$     /home/index.html [R=301]

my mod_perl2 module in some condition need to redirect the browser to
another site. But my web server ignored my module.

This is the code:

 use Apache2::RequestRec ();
  use Apache2::RequestUtil ();
  use Apache2::SubRequest ();
  use Apache2::Log;
  use Apache2::Filter ();
  use APR::Table ();
  use LWP::Simple;
  use Apache2::Const -compile => qw(OK REDIRECT DECLINED);
sub handler    {
    my $f = shift;
    my $return_value=Apache2::Const::DECLINED;
    my $user_agent=lc($f->headers_in->{'User-Agent'}|| '');
    if ($user_agent =~ m/iphone/i) {
        $f->headers_out->set(Location => $location);
$f->status(Apache2::Const::REDIRECT);
$return_value=Apache2::Const::REDIRECT;
    }
    return $return_value;
  }

What is wrong, it's possible to do  ?

thanks
Idel
=====================
E-Mail: [email protected]
Web Site: http://www.idelfuschini.it
AMF project:  http://www.apachemobilefilter.org
AMF wiki: Apache Mobile Filter - http:/wiki.apachemobilefilter.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.