public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Hilco Wijbenga <hilco.wijbenga@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [Apache HTTPD] Why doesn't my RewriteRule fire?
Date: Mon, 22 Aug 2011 15:13:24 -0700	[thread overview]
Message-ID: <CAE1pOi0OrMm5NJ6zDtK75dKZ2VJYC_G73tS+cORFKARjmYLuFQ@mail.gmail.com> (raw)
In-Reply-To: <CAEH5T2O9HPHx5bHBNbLJwmdvOxsbJH-QCTMMfbLO3EVv99bppw@mail.gmail.com>

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:
>>  RewriteRule ^/website$    http://localhost/website/ [T]
>>  ProxyPassMatch    ^/website/(.*)$
>> http://localhost:8000/website/$1
>> </VirtualHost>
>>
>> The ProxyPassMatch fires but (AFAICT) the RewriteRule does not. I.e.
>> http://localhost/website (no slash) ==> 404 (in fact, it's trying to
>> serve /var/www/localhost/htdocs/website) but http://localhost/website
>> (with slash) ==> 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,  but 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.



      reply	other threads:[~2011-08-22 22:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 21:07 [gentoo-user] [Apache HTTPD] Why doesn't my RewriteRule fire? Hilco Wijbenga
2011-08-22 21:31 ` Paul Hartman
2011-08-22 22:13   ` Hilco Wijbenga [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE1pOi0OrMm5NJ6zDtK75dKZ2VJYC_G73tS+cORFKARjmYLuFQ@mail.gmail.com \
    --to=hilco.wijbenga@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox