From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-127261-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1QvclP-0006mC-Q6
	for garchives@archives.gentoo.org; Mon, 22 Aug 2011 22:14:37 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id EFE1D21C279;
	Mon, 22 Aug 2011 22:14:23 +0000 (UTC)
Received: from mail-yw0-f53.google.com (mail-yw0-f53.google.com [209.85.213.53])
	by pigeon.gentoo.org (Postfix) with ESMTP id 48DE621C155
	for <gentoo-user@lists.gentoo.org>; Mon, 22 Aug 2011 22:13:25 +0000 (UTC)
Received: by ywb5 with SMTP id 5so4962852ywb.40
        for <gentoo-user@lists.gentoo.org>; Mon, 22 Aug 2011 15:13:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding;
        bh=CiMu7J53RRG1hIicZewin2dANrZNIOlxBuG9Gk59izI=;
        b=WeTwti6of6WIF4pjBmVEM3zF00mXoZ07P72hiFBvod1TMnF73r8Iit/z8mj5WfbCrT
         eWg0POhjqYE1II4JByPoToa47+qB1rZVTPVtiN3I5JGqQ/oX3zm1WL6rvCcP/jCkq9sy
         zFwVFFYbtueCpodju6IbL8ceuur4ENnJBhPsw=
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.236.145.130 with SMTP id p2mr17723048yhj.125.1314051204628;
 Mon, 22 Aug 2011 15:13:24 -0700 (PDT)
Received: by 10.236.207.67 with HTTP; Mon, 22 Aug 2011 15:13:24 -0700 (PDT)
In-Reply-To: <CAEH5T2O9HPHx5bHBNbLJwmdvOxsbJH-QCTMMfbLO3EVv99bppw@mail.gmail.com>
References: <CAE1pOi3oHj5yO88=KtA1KUstne9w8GxDfEgTKz55Aks1BtZr4w@mail.gmail.com>
	<CAEH5T2O9HPHx5bHBNbLJwmdvOxsbJH-QCTMMfbLO3EVv99bppw@mail.gmail.com>
Date: Mon, 22 Aug 2011 15:13:24 -0700
Message-ID: <CAE1pOi0OrMm5NJ6zDtK75dKZ2VJYC_G73tS+cORFKARjmYLuFQ@mail.gmail.com>
Subject: Re: [gentoo-user] [Apache HTTPD] Why doesn't my RewriteRule fire?
From: Hilco Wijbenga <hilco.wijbenga@gmail.com>
To: gentoo-user@lists.gentoo.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: 0532f4b648ab9dd13a9416edf6c023c5

On 22 August 2011 14:31, Paul Hartman <paul.hartman+gentoo@gmail.com> wrote=
:
> On Mon, Aug 22, 2011 at 4:07 PM, Hilco Wijbenga
> <hilco.wijbenga@gmail.com> wrote:
>> =C2=A0RewriteRule ^/website$ =C2=A0 =C2=A0http://localhost/website/ [T]
>> =C2=A0ProxyPassMatch =C2=A0 =C2=A0^/website/(.*)$
>> http://localhost:8000/website/$1
>> </VirtualHost>
>>
>> The ProxyPassMatch fires but (AFAICT) the RewriteRule does not. I.e.
>> http://localhost/website (no slash) =3D=3D> 404 (in fact, it's trying to
>> serve /var/www/localhost/htdocs/website) but http://localhost/website
>> (with slash) =3D=3D> works.
>
> Disclaimer: I am not an Apache guru :)

Well, you know more than I do. :-)

> You have [T] as third parameter to RewriteRule, which is used to
> specify a MIME type, =C2=A0but you're not specifying anything. Maybe that
> invalidates the rule. Try removing it.
>
> You can also specify multiple RewriteRules which are processed in
> sequence, if trailing slash works maybe you need to first add a rule
> convert URL with no slash to URL with slash:
>
> RewriteRule ^/website$ /website/ [R]

I used to have [P] and then tried [PT] but neither worked. Then for
some unknown reason I deleted the P and left [T] when I sent the
email.

The problem turns out to be that you must put the Rewrite*
configuration stuff in the virtual host, not outside. Then it works.
It's documented but I had glossed over it.