--- TransHandler.pm.orig	2007-09-14 10:33:12.000000000 +0200
+++ TransHandler.pm	2007-09-14 10:34:23.000000000 +0200
@@ -72,12 +72,12 @@
 
         if ($uri !~ /^(http|https):\/\/(.*)/ ) {
                 my $rewrite_uri2 = APR::URI->parse($r->pool, $real_post_url);
-                my $path = $rewrite_uri2->path;
-                $path = $path . $uri;
+                my $path = $rewrite_uri2->path();
+                $path =~ s/[^\/]+$/$uri/g;
+                $rewrite_uri2->path($path);
                 $uri = $rewrite_uri2->unparse;
         }
         my $rewrite_uri = APR::URI->parse($r->pool, $uri);
-        $log->debug($uri);
         $rewrite_uri->hostname($app->{'name'});
         $rewrite_uri->scheme('http');
         $rewrite_uri->scheme('https') if $r->is_https;
@@ -269,7 +269,7 @@
                                         $r->headers_out->add('Location' => rewrite_uri($r,$app,$1,$real_post_url,$log));
                                 }
 			if ($response->code =~ /^30(.*)/ ) { #On gère les redirections de type 30x
-				$r->headers_out->add('Location' => rewrite_uri($r,$c,$app,$response->headers->header('location'),$real_post_url,$log));
+				$r->headers_out->add('Location' => rewrite_uri($r,$app,$response->headers->header('location'),$real_post_url,$log));
 			}
 			else {
 				$session{urlpost}= rewrite_uri($r,$app,$real_post_url,$real_post_url,$log);	#On récupère l'url du post vu de l'exterieur pour le ResponseHandler.pm

