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

Scott Walter sw-ng at scottwalter.com
Mon Mar 26 09:14:55 EDT 2007


Yeah I know this question probably didn't belong here, but I figured  
some other "Mongrels" have had similar issues and I thought I'd give  
it a try.  Good thing too because your help worked like a champ!   
Thanks.

scott.
On Mar 26, 2007, at 3:58 AM, Vincent Bray wrote:

> 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
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users



More information about the Mongrel-users mailing list