[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 216.154.219.19:80>
[snip]
> RewriteEngine On
> RewriteRule ^a\.html$ b.html
[snip]
> </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 / http://127.0.0.1:3002/
ProxyPassReverse / http://127.0.0.1:3002/
ProxyPreserveHost On
RewriteEngine On
RewriteRule ^/a.html /b.html

.. or ..

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

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

-- 
noodl


More information about the Mongrel-users mailing list