How to set a root URL ?

316 views
Skip to first unread message

Pierre L

unread,
Feb 9, 2009, 7:57:10 AM2/9/09
to Ruby on Rails: Talk
Hello,

My server installation of RoR is working but I still have a problem
with routes. I would like the root URL of my site to be some thing
like mydomain.com/mysite/ . But this is not working since Rails
include the '/mysite/' in his routing. Of course, if in all
connections in routes.rb I add '/mysite', all is working, but is there
another way to tell Rails that my root URL is not '/' ?

Thank you for all,
Pierre L.

Maurício Linhares

unread,
Feb 9, 2009, 7:59:32 AM2/9/09
to rubyonra...@googlegroups.com
AFIK, no, there isn't.

What you could do, if you really need something like this (I can't see
a reason...) is, at the "root_path" redirect to this URL that you want
to be your root.

-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)

James Mitchell

unread,
Feb 9, 2009, 8:03:21 AM2/9/09
to rubyonra...@googlegroups.com
Is your app fronted by Apache?

--
James Mitchell

Pierre L

unread,
Feb 9, 2009, 9:24:39 AM2/9/09
to Ruby on Rails: Talk

Yes it is ! Is there a solution with the htaccess ?

Pierre L

unread,
Feb 9, 2009, 9:29:02 AM2/9/09
to Ruby on Rails: Talk

In fact, my site is still in development, I don't want to put it on
the root of my domain, but in a directory.
I think I miss something simple because I've done tests few months ago
and all was ok.

On 9 fév, 13:59, Maurício Linhares <mauricio.linha...@gmail.com>
wrote:

Pierre L

unread,
Feb 9, 2009, 12:56:37 PM2/9/09
to Ruby on Rails: Talk

I've found : all one have to do it to put
config.action_controller.relative_url_root = '/yourpath'
in the config file.
Reply all
Reply to author
Forward
0 new messages