# Adding a global path prefix in routes

**URL:** <https://www.ruby-forum.com/t/adding-a-global-path-prefix-in-routes/144156>\
**Category:** Rails\
**Created:** [July 25, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/adding-a-global-path-prefix-in-routes/144156 "2008-07-25T23:17:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b487fb/32.png) [@nini](https://www.ruby-forum.com/u/nini)\
**Post date:** [July 25, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/adding-a-global-path-prefix-in-routes/144156/1 "2008-07-25T23:17:12Z")

</div>

I’m having some trouble figuring out how to add a path prefix to _all_  
paths in a site. I see the option to use :path\_prefix when using  
resources, but this isn’t exactly what I want. I would simply like to  
add a static prefix of /events/foo/ to all paths, including the root  
url (for now, until I create a proper events controller). I attempted  
to do this using map.root but it looks as though this is not the  
correct place to do it. I am rather confused at this point, and would  
appreciate any suggestions on the best and easiest way to go about  
doing this.

Thanks!

---

<div class="post-metadata">

**Author:** ![nini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b487fb/32.png) [@nini](https://www.ruby-forum.com/u/nini)\
**Post date:** [September 4, 2008, 1:12pm UTC](https://www.ruby-forum.com/t/adding-a-global-path-prefix-in-routes/144156/2 "2008-09-04T13:12:59Z")

</div>

if u are using mongrel, you can add the global prefix like this:  
mongrel\_rails start --prefix /myapp  
the Path following --prefix must begin with /
