How do I get Rails3 apps running correctly in a subdirectory (ie. http://username.webfactional.com/app_name/)
Without touching the routes file, I can access login/public pages (etc).
the static files work.
Now I need the links/routes to work correctly. Using scoped routes:
are the "official" way to do this. However, I assume due to how Apache handles the app requests the /app_name/ part of the route never makes it to the mapping. I always get this error:
Obviously, /login won't exists since the scoping makes the url matching /app_name/login.
asked 06 Jan '11, 14:43
Have you tried adding,
To your environments.rb file? This line must be added within the config block or it will not work. The first line in the config block will look like this:
For those who have the same question:
The Official Answer from Webfaction is that its not possible on their servers.
Their front-end server removes the /app_name when it sends requests so the routes will never see that. The only option is to duplicate all routes. The first copy is your normal copy. The second copy is scoped to use your "/app_name" in front.
Either all that work, or use a subdomain (what I did).
answered 12 Jan '11, 10:14
Check out this post: Deploying a Rails 3.1 app to subdirectory in Apache
answered 09 Sep '11, 16:42