package Apache2::Authclients; use Apache2::RequestRec (); # for $r->content_type use Apache2::Connection (); # for $c->remote_ip use Apache2::SubRequest (); # for $r->internal_redirect use Apache2::Const -compile => ':common'; sub handler { my $r = shift; my $c = $r->connection(); if ( check_ip($c->remote_ip(), $r->dir_config('product')) ) { $r->internal_redirect($r->uri); } else { $r->internal_redirect('/path/to/login'); } }