Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 82550 invoked from network); 16 Oct 2005 15:39:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Oct 2005 15:39:22 -0000 Received: (qmail 92735 invoked by uid 500); 16 Oct 2005 15:39:10 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 92714 invoked by uid 500); 16 Oct 2005 15:39:09 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 92702 invoked by uid 99); 16 Oct 2005 15:39:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Oct 2005 08:39:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [82.92.184.195] (HELO sanguis.xs4all.nl) (82.92.184.195) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Oct 2005 08:39:10 -0700 Received: from localhost (localhost.joost.localnet [127.0.0.1]) by sanguis.xs4all.nl (Postfix) with ESMTP id C06B7905F for ; Sun, 16 Oct 2005 17:38:40 +0200 (CEST) Received: from sanguis.xs4all.nl ([127.0.0.1]) by localhost (sanguis.xs4all.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12494-04 for ; Sun, 16 Oct 2005 17:38:40 +0200 (CEST) Received: from [192.168.1.58] (joost.joost.localnet [192.168.1.58]) by sanguis.xs4all.nl (Postfix) with ESMTP id 586D89004 for ; Sun, 16 Oct 2005 17:38:40 +0200 (CEST) Message-ID: <43527406.3090108@sanguis.xs4all.nl> Date: Sun, 16 Oct 2005 17:38:46 +0200 From: Joost de Heer User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Strange mod_rewrite behaviour? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at sanguis.xs4all.nl X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N In the mod_rewrite examples page the following can be found: RewriteEngine on RewriteCond %{REQUEST_URI} !-U RewriteRule ^(.*) http://webserverB.dom/$1 [Not related comment: shouldn't this be ^/(.*)] A request for http://localhost/foo/bar results in the following log: 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4b1900/initial] (2) init rewrite engine with requested uri /foo/bar 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4b1900/initial] (3) applying pattern '^(.+)' to uri '/foo/bar' 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4c7a48/subreq] (2) init rewrite engine with requested uri /foo/bar 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4c7a48/subreq] (3) applying pattern '^(.+)' to uri '/foo/bar' 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4c7a48/subreq] (4) RewriteCond: input='/foo/bar' pattern='!-U' => matched 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4c7a48/subreq] (2) rewrite /foo/bar -> http://webserverB.dom//foo/bar 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4c7a48/subreq] (2) implicitly forcing redirect (rc=302) with http://webserverB.dom//foo/bar 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4c7a48/subreq] (1) escaping http://webserverB.dom//foo/bar for redirect 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4c7a48/subreq] (1) redirect to http://webserverB.dom//foo/bar [REDIRECT/302] 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4b1900/initial] (5) RewriteCond URI (-U) check: path=/foo/bar -> status=302 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4b1900/initial] (4) RewriteCond: input='/foo/bar' pattern='!-U' => not-matched 127.0.0.1 - - [16/Oct/2005:17:34:06 +0200] [windows.joost.localnet/sid#46a8b0][rid#4b1900/initial] (1) pass through /foo/bar So instead of getting redirected, the -U seems to get applied again, sees the request resulted in a 302 redirect, and decides that it's a valid URL after all, so it's passed through, leading to a 404 error, instead of the redirect. Am I misinterpreting the results, is the example wrong, or is something weird going on in mod_rewrite with -U? Joost