# Rewriting url path element as parameter

**URL:** <https://www.ruby-forum.com/t/rewriting-url-path-element-as-parameter/146609>\
**Category:** Rails\
**Created:** [August 22, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/rewriting-url-path-element-as-parameter/146609 "2008-08-22T23:44:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@Allan](https://www.ruby-forum.com/u/Allan)\
**Post date:** [August 22, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/rewriting-url-path-element-as-parameter/146609/1 "2008-08-22T23:44:02Z")

</div>

Hi,

I’d like to rewrite the url:

[http://myapp.mycompany.com/project\_name/some\_action/id?](http://myapp.mycompany.com/project_name/some_action/id?)…

to

[http://myapp.mycompany.com/some\_action/id?...&project=project\_name](http://myapp.mycompany.com/some_action/id?...&project=project_name)

or map it somehow to the appropriate rails controller.

I’d prefer to do this without recourse to mod\_rewrite, etc in the web  
server and manage to handle this in my application. I couldn’t see any  
examples in my googling though I do recall that I have seen some  
routes dynamically added within a rails application setup.

Any ideas or pointers to examples?

Thanks,

Allan
