0

I need to host two rails app in one server and I don't have so many domain names. So I followed http://mattconnolly.wordpress.com/2010/09/19/redmine-ruby-on-rails-without-virtual-hosts/ which works. The root url changes from http://{virtual-host}/ to http://{main-domain}/railsapp/

My problem is when I do something like:

redirect_to root_path

I am redirected to http://{main-domain}/ instead of http://{main-domain}/railsapp/ as expected. I can of course

redirect_to '/railsapp'

but is there a better way than to repeat /railsapp all over the app?

cpliu338
  • 645
  • 1
  • 7
  • 20
  • http://stackoverflow.com/questions/2660172/how-do-i-set-default-host-for-url-helpers-in-rails – Will Oct 30 '14 at 09:23

1 Answers1

0

Try to configure config.relative_url_root

http://edgeguides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root

MrWEST
  • 158
  • 5