Access Rails under /app/, not /app/public/

Posted by blinry on Server Fault See other posts from Server Fault or by blinry
Published on 2010-05-06T13:20:06Z Indexed on 2010/05/06 13:28 UTC
Read the original article Hit count: 188

Filed under:
|
|
|
|

I'm trying to deploy Rails 2.1.2 with Apache 2.2.10 and FastCGI (yeah, bad, ancient, ugly, I know).

My application can be accessed via example.com/app/public/, but I want to access it via example.com/app/.

In my .htaccess-File (in the app/-directory!) I have:

RewriteEngine On

RewriteBase /app/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/dispatch.fcgi [QSA,L]

How can I forward each request going to app/ to app/public/? Every time I try this (like, with RewriteRule ^.*$ public/$1 [QSA]) I get a routing error:

No route matches "/app/" with {:method=>:get}

Help?

© Server Fault or respective owner

Related posts about apache

Related posts about htaccess