From: Eric Lenio Subject: mp2: PerlTransHandler/proxying with question mark in URL Date: 16:30 on 30 Oct 2004
In my apache config file I'm using a PerlTransHandler call to do URL rewriting.
Basically I want to map all URL's beginning with
http://testhost.lenio.net
to internally to go to:
http://localhost:8080
This works perfectly except when I introduce a URL with a question
mark like this:
http://testhost.lenio.net?argument1=some_value
The proxy seems to try to escape the question mark to be %3F, but that's where
I'm getting lost. Thoughts? Here's the actual PerlTransHandler:
use Apache::RequestRec ();
use Apache::Const -compile => qw(DECLINED :common);
sub handler {
my $r = shift;
my $hostname = $r->hostname;
my $real_url = $r->unparsed_uri;
if ($hostname =~ m{^testhost\.}i) {
$r->proxyreq(1);
$r->uri($real_url);
$r->filename(sprintf "proxy:http://localhost:8080%s",$real_url);
$r->handler('proxy-server');
return Apache::OK;
}
return Apache::DECLINED;
}
1;
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
mp2: PerlTransHandler/proxying with question mark in URL
Eric Lenio 16:30 on 30 Oct 2004