Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 25556 invoked by uid 500); 5 Apr 2002 00:12:34 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 25545 invoked from network); 5 Apr 2002 00:12:34 -0000 Received: from smtp01.mrf.mail.rcn.net (207.172.4.60) by daedalus.apache.org with SMTP; 5 Apr 2002 00:12:34 -0000 Received: from [207.172.7.25] (helo=wsdell0e0ck) by smtp01.mrf.mail.rcn.net with smtp (Exim 3.33 #10) id 16tHLN-0005ml-00 for users@httpd.apache.org; Thu, 04 Apr 2002 19:12:41 -0500 Message-ID: <026501c1dc36$9957fe30$8918970a@spg.va> From: "Chet Luther" To: Subject: [mod_rewrite] Problems with an initially empty URL. Date: Thu, 4 Apr 2002 19:12:40 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Users, First off, my relevant information: Apache 1.3.22 (Using this version because of single cookie bug in 23/24.) on Solaris 8. I am attempting to proxy a PeopleSoft web application that has the annoying habit of constructing escaped HREF and SRC attributes like such: http%3a%2f%2fps-web.mycorp.net%3a8800%2fservlets%2ficlientservlet%2fpeopleso ft8portal%2f This causes my rewrite rules to treat it as a relative URL although it should really be absolute. These improperly escaped URLs end up getting rewritten into something like this: /servlets/psportal/peoplesoft8portal/http://ps-web.mycorp.net:8800/servlets/ iclientservlet/peoplesoft8portal/ The relevant portion of my httpd.conf: > ServerName ps-web.mycorp.net > Listen 8800 > > CustomLog /path/to/apache/logs/custom.log "\n%p) %U%q\n%p) %{REWRITE}e\n" > TransferLog /path/to/apache/logs/custom.log > > RewriteEngine On > RewriteRule ^(.*)$ $1 [E=REWRITE:$1] > RewriteRule ^/(.*)$ to://medusa.corp.rcn.net:8800/$1 > RewriteRule ^to://([^/]+)/(.*) http://$1/$2 [E=SERVER:$1,P,L] > RewriteRule .* - [F] > > ProxyRequests On > NoCache * > > ProxyPassReverse / http://ps-web.mycorp.net:8800/ An example log snippet showing the empty URL string mod_rewrite is seeing. The top line is generated by the TransferLog directive, and the bottom by the RewriteLog. > 443) /servlets/psportal/peoplesoft8portal/http://ps-web.mycorp.net:8800/servlets/ iclientservlet/peoplesoft8portal/ > 443) - An example log snippet of a URL that wasn't escaped: > 443) /servlets/iclientservlet/peoplesoft8portal/ > 443) /servlets/iclientservlet/peoplesoft8portal/ My first reaction would be to just add another rewrite rule to properly rewrite in this case, but I can't rewrite a URL that doesn't exist. Any suggestions would be very welcome. Thanks in advance, Chet Luther chet@rcn.com --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org