[Mongrel] Can't seem to get rewrite rules to work with Apache

Vincent Bray noodlet at gmail.com
Mon Mar 26 04:58:46 EDT 2007

On 25/03/07, Scott Walter <sw-ng at scottwalter.com> wrote:
> Here is my  Apache configuration:
> <VirtualHost>
> RewriteEngine On
> RewriteRule ^a\.html$ b.html
> </VirtualHost>

Because your rule is in vhost context (and not in your Directory
block) you must include the leading slash. You may also want to bypass
the ProxyPass, or switch to using [P] instead.

ProxyPass /a.html !
ProxyPass /b.html !
ProxyPass /
ProxyPassReverse /
ProxyPreserveHost On
RewriteEngine On
RewriteRule ^/a.html /b.html

.. or ..

RewriteEngine On
RewriteCond %{REQUEST_URI} !^(a|b)\.html
RewriteRule .{REQUEST_URI} [P]
ProxyPassReverse /
ProxyPreserveHost On

I suspect this question really belongs on an apache support list.


More information about the Mongrel-users mailing list