Forum: Ruby on Rails add prefix to all urls ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Thani A. (Guest)
on 2008-11-13 18:07
hi
i want to add a prefix to all urls in my project

for example ,now i have like this
"http://localhost:3000/posts"


but
i want like this
"http://localhost:3000/my_blog/posts"
"http://localhost:3000/my_blog/posts/new"
"http://localhost:3000/my_blog/posts/edit/1"
"http://localhost:3000/my_blog/*/*..."


"my_blog" prefix should come all of my blog project link

how to do that ?
Elias O. (Guest)
on 2008-11-13 18:12
(Received via mailing list)
Hello Thani,

Try something like this:

map.resources :posts, :path_prefix => '/my_blog'

Hope it helps,

Elías



On Nov 13, 11:07 am, Thani A. <removed_email_address@domain.invalid>
Jack C. (Guest)
on 2008-11-13 18:22
(Received via mailing list)
Thani A. wrote:
> "http://localhost:3000/my_blog/posts/new"
> "http://localhost:3000/my_blog/posts/edit/1"
> "http://localhost:3000/my_blog/*/*..."
>
>
> "my_blog" prefix should come all of my blog project link
>
> how to do that ?
>
If your using apache you might look into mod_rewrite.

--
Jack C.
removed_email_address@domain.invalid
Thani A. (Guest)
on 2008-11-14 06:58
Jack C. wrote:
> If your using apache you might look into mod_rewrite.
>
> --
> Jack C.
> removed_email_address@domain.invalid

thanks all of you..

i am using apache
how could i change mod_write
Thani A. (Guest)
on 2008-11-14 07:11
Elias O. wrote:
> Hello Thani,
>
> Try something like this:
>
> map.resources :posts, :path_prefix => '/my_blog'
>
> Hope it helps,
>
> El�as
>
>
>
> On Nov 13, 11:07�am, Thani A. <removed_email_address@domain.invalid>

if i want to use all of my roots then what should i do ?
This topic is locked and can not be replied to.