Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

Well, your vhosts file seems to be pointing to the public folder, since your getting the routing error, so the rails environment is loaded.

First try to move your .htaccess inside the public folder. The public folder should be the root of your website, for example, my rails app run on www.mydomain.com/ and if I put a file.html on the public folder, i can access on www.mydomain.com/file.html .

But when you have a route on the routes.rb file, you can access on www.mydomain.com/myroute .

Sorry for the quick response.

share|improve this answer
    
Did you figure it out? –  rafamvc Dec 29 '10 at 3:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.