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.
C5c0e0499446b84fd3bcc61cf7862539?d=identicon&s=25 Thani Ararsu (thaniyarasu)
on 2008-11-13 17: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 ?
A1247f73598357f06388e863c41aa624?d=identicon&s=25 Elias Orozco (elioncho)
on 2008-11-13 17: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 Ararsu <rails-mailing-l...@andreas-s.net>
89441a6c74647d292f5cc951eae24cfa?d=identicon&s=25 Jack Christensen (Guest)
on 2008-11-13 17:22
(Received via mailing list)
Thani Ararsu 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 Christensen
jackc@hylesanderson.edu
C5c0e0499446b84fd3bcc61cf7862539?d=identicon&s=25 Thani Ararsu (thaniyarasu)
on 2008-11-14 05:58
Jack Christensen wrote:
> If your using apache you might look into mod_rewrite.
>
> --
> Jack Christensen
> jackc@hylesanderson.edu

thanks all of you..

i am using apache
how could i change mod_write
C5c0e0499446b84fd3bcc61cf7862539?d=identicon&s=25 Thani Ararsu (thaniyarasu)
on 2008-11-14 06:11
Elias Orozco 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 Ararsu <rails-mailing-l...@andreas-s.net>

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