Are there reasons you don't want to use mod_proxy, or Apache::ProxyRewrite 
(ProxyRewrite may not work on mp2)?

Adam

-----Original Message-----
From: Eric Lenio [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 20, 2005 10:57 PM
To: Philip M. Gollucci
Cc: Eric Lenio; modperl@perl.apache.org
Subject: Re: proxy question: URL with parameters


On Thu, Oct 20, 2005 at 10:47:02PM -0400, Philip M. Gollucci wrote:
> Eric Lenio wrote:
> >The handler converts the question mark to %3f and the proxy request 
> >basically
> >fails.  I'm using modperl 1.99.11, I'd like to fix this before moving in to
> >2.0.2.  Suggestions?
> Post the relevant configs please.

Here are the key parts of the code.  Anything else Philip?

package LenioApache::RewriteURI;

use strict;
use warnings;

use Apache::RequestRec ();

use Apache::Const -compile => qw(DECLINED :common);

sub handler {
  my $r = shift;
  my $hostname = $r->hostname;
  my $port     = $r->get_server_port;
  my $real_url = $r->unparsed_uri;
  if ($hostname =~ m{^hplg2\.}i) {
    $r->proxyreq(1);
    $r->uri($real_url);
    $r->filename(sprintf "proxy:http://192.168.0.4:8080%s",$real_url);
    $r->handler('proxy-server');
    return Apache::OK;
  }
  return Apache::DECLINED;
}
1;

Reply via email to