perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Shz" <johnny....@gmail.com>
Subject Help with PerlTransHandler
Date Sun, 22 May 2005 22:28:26 GMT
Hi, I'm trying to write my own translation handler. The problem is that I'd like to map something
like:

    /foo.html to /bar/servlet/test

where /bar/ is supposed to be handled by mod_jk with something like:
    <Location "/bar">
        JkUriSet worker ajp13:localhost:8009
    </Location>

When I tried to use mod_rewrite, the mapping took effect, but then apache tried to find the
file: "/bar/servlet/test" 
rather than applying the <Location/> to send to mod_jk.

I thought a mod_perl's PerlTransHandler will solve this problem, with a simple:

package Urlmap;
use strict;
use Apache2::Const -compile => qw(DECLINED);
use Apache2::RequestRec;

sub handler{
    my $r = shift;
    my $uri = $r->uri;
    my $target = "";
    if($uri =~ m|^/foo.html|i){
        $r->uri("/bar/servlet/test");
    }
    return Apache2::Const::DECLINED;
}

But it is giving me the same error, it returns a 404 file not found for "/bar/servlet/test".

So how can I change the URL, and still apply the <Location/> directive afterwards?

Thanks.

Z.




Mime
View raw message