Forum: Ruby on Rails Redirecting root to mongrel prefix

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jeff E. (Guest)
on 2009-01-28 17:22
(Received via mailing list)
Mongrel can be started with a prefix e.g.

  mongrel_rails start -p 3000 --prefix /foobar

So that all of the app's URLs are prefixed, e.g.


The problem is that if you hit just the root ( http://localhost:3000/
) then mongrel responds with "NOT FOUND".

I tried adding an index.html to RAILS_ROOT/public that redirects to /
foobar, but this results in an infinite loop.

Does anyone know how to get requests to the root to redirect to the
Freddy A. (Guest)
on 2009-01-28 18:50
(Received via mailing list)
I think you are missing a piece of the puzzle, Apache and

You would never run multiple app roots unless you had multiple apps
and or a php app on / and a rails app on /app1...

If you want multiple apps running on your dev env just start them with
-p 3001 -p 3002 ... ? much easier... but I guess that depends on what
you are trying to do ...
Jeff E. (Guest)
on 2009-01-28 19:13
(Received via mailing list)
On Jan 28, 11:50 am, Freddy A. <removed_email_address@domain.invalid> wrote:
> I think you are missing a piece of the puzzle, Apache and
> mod_proxy...

Yes, this is running behind Apache.  We have a Java app that runs at

We have Apache proxy forwarding to that ajax calls aren't cross-domain to the java app.

The issue with redirecting the root requests to the prefixed URL is
more a matter of convenience, just so someone doesn't see "NOT FOUND"
if they happen to hit the root URL.
This topic is locked and can not be replied to.