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: idel.fusch...@gmail.com
Web Site: http://www.idelfuschini.it
AMF project:  http://www.apachemobilefilter.org
AMF wiki: Apache Mobile Filter - http:/wiki.apachemobilefilter.org

Reply via email to