0

I am using rails on an Apache server. I can't install my rails app on the public root directory. So I have it on /web. With an .htaccess I rewrite any URL from / to /web. For example /something will be /web/something and so on.

Now, in my app, I build my links with the url helper link_to:

link_to "Timeline", timeline_path

But it yields /web/en/timeline instead of /en/timeline. The en is just the locale to work with i18n.

Is there a way to force link_to to create just the /en/timeline path or do I have to write it manually? Like so:

link_to "Timeline", "/en/timeline"

Edit: To add info as JoseE ask.

This is my routes.rb file:

  get "home/index"
  root:to => 'home#index'
  match '/:locale' => 'home#index'

  scope "/:locale" do
    match 'timeline' => 'timeline_articles#index'
    match 'home' => 'home#index'
  end
pzin
  • 4,200
  • 2
  • 28
  • 49
  • For starters, it'd be useful to see your config/routes.rb file. – jlstr Apr 28 '13 at 16:04
  • This answer may help: (http://stackoverflow.com/questions/12110334/deploy-2-sites-on-same-apache-server) – Ian Kenney Apr 28 '13 at 16:06
  • @IanKenney I was looking and reading that answer, but on the [phusion documentation](http://www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_a_ruby_on_rails_1_x_or_2_x_but_not_rails_gt_3_x_application) it says that that will just work for rails 1.x 2.x **but not 3.x**. I actually use 3.x. – pzin Apr 28 '13 at 16:27
  • This doesn't seem to be an issue related to the rails stack. /web seems to be appended to your domain. (and isn't that the intended effect you wanted in the 1st place?), This problem is related to Apache, so I strongly suggest to you that you add that Tag to this question. – jlstr Apr 28 '13 at 16:27
  • This seems like an apache config issue, not Rails. – cpuguy83 Apr 28 '13 at 16:29
  • My hosting provider says me it is not possible to do this on a VPS. Is there any other solution? – pzin Apr 30 '13 at 17:35

0 Answers0