The .htaccess file in your public directory has the following lines which you should uncomment / modify as required:
# If your Rails application is accessed via an Alias directive, # then you MUST also set the RewriteBase in this htaccess file. # # Example: # Alias /myrailsapp /path/to/myrailsapp/public # RewriteBase /myrailsapp I hope that helps! Regards, Gustav Paul On Tue, Jul 21, 2009 at 6:56 AM, Bill McGuire < [email protected]> wrote: > > Hello...I use a hosting company that allows me to run multiple ruby apps > at the same time. To do that I'm required to do a re-write (.htaccess > entry) so that at incoming http requests can be directed to the right > app port. > > http://mysite.com/myrailsapp >> maps to >> > http://mysite.com:12007/myrailsapp > > All I have to do is add :path_prefix and prepend the default routes in > my routes.rb file like so: > map.resources :players, :path_prefix => 'myrailsapp' > > map.connect 'loser/:controller/:action/:id' > map.connect 'loser/:controller/:action/:id.:format' > > This creates routes like : > players GET /myrailsapp/players(.:format){ > :controller=>"players", > :action=>"index"} > > Everything works fine in the program except when I go to grab an image > or reference a stylesheet. If I enter: > http://mysite.com/myrailsapp/images/logo.gif > > It attempts to route it to a controller. Is this an issue I should fix > with .htaccess or routes.rb? I've attempted to do both without much > luck (not too good with .htaccess). I'm leaning towards some kind of > redirect in .htaccess but not sure if this is the best approach or how > to do it. > Any help is appreciated. > Thanks...Bill > -- > Posted via http://www.ruby-forum.com/. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

