Add prefix to all urls?


#1

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 ?


#2

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


#3

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


#4

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 ?


#5

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