# Routing and extensions

**URL:** <https://www.ruby-forum.com/t/routing-and-extensions/58769>\
**Category:** Rails\
**Created:** [April 25, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/routing-and-extensions/58769 "2006-04-25T19:38:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KSadam\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/d78d45/32.png) [@KSadam\_C](https://www.ruby-forum.com/u/KSadam_C)\
**Post date:** [April 25, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/routing-and-extensions/58769/1 "2006-04-25T19:38:42Z")

</div>

I would like my something like “my\_page.html” to map to :controller =\>  
‘page’, :action =\> ‘my\_page’. How can I accomplish that?

Is there a way to make the routing parse other things other than ‘/’?

---

<div class="post-metadata">

**Author:** ![KSadam\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/d78d45/32.png) [@KSadam\_C](https://www.ruby-forum.com/u/KSadam_C)\
**Post date:** [April 26, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/routing-and-extensions/58769/2 "2006-04-26T17:14:14Z")

</div>

K. Adam Christensen wrote:

> I would like my something like “my\_page.html” to map to :controller =\>  
> ‘page’, :action =\> ‘my\_page’. How can I accomplish that?
> 
> Is there a way to make the routing parse other things other than ‘/’?

What I have done is perform some checking in the controller to get this  
to work. This feels sloppy. Does anyone have any other ideas?

I’m trying to integrate an old site that used php and other html pages  
to ruby, and I don’t want to have to change all of the links and  
whatnot, because there is legacy there.

---

<div class="post-metadata">

**Author:** ![KSadam\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/d78d45/32.png) [@KSadam\_C](https://www.ruby-forum.com/u/KSadam_C)\
**Post date:** [April 27, 2006, 4:11pm UTC](https://www.ruby-forum.com/t/routing-and-extensions/58769/3 "2006-04-27T16:11:17Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![KSadam\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/d78d45/32.png) [@KSadam\_C](https://www.ruby-forum.com/u/KSadam_C)\
**Post date:** [April 27, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/routing-and-extensions/58769/4 "2006-04-27T17:02:46Z")

</div>

map.connect ‘/mypage/mypage.html’, :controller =\> “mypage”, :action =\>  
“mypage”

---

<div class="post-metadata">

**Author:** ![KSadam\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/d78d45/32.png) [@KSadam\_C](https://www.ruby-forum.com/u/KSadam_C)\
**Post date:** [April 27, 2006, 5:13pm UTC](https://www.ruby-forum.com/t/routing-and-extensions/58769/5 "2006-04-27T17:13:57Z")

</div>

K. Adam Christensen wrote:

> Mohammad wrote:
> 
> > map.connect ‘/mypage/mypage.html’, :controller =\> “mypage”, :action =\>  
> > “mypage”
> 
> is there a way to do that where in the first argument of  
> ‘/mypage/mypage.html’, something like ‘/:controller/:action.html’(which  
> doesn’t work). I can use a variable of some sort. I do not want to  
> re-map all of the pages on this site like that.  
> map.connect ‘/mypage/:action’, :controller =\> “mypage”  
> now for making :action.html I would see if that works it might. But  
> :action is a hash so it might take it as a command so…

---

<div class="post-metadata">

**Author:** ![KSadam\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/d78d45/32.png) [@KSadam\_C](https://www.ruby-forum.com/u/KSadam_C)\
**Post date:** [April 27, 2006, 5:09pm UTC](https://www.ruby-forum.com/t/routing-and-extensions/58769/6 "2006-04-27T17:09:03Z")

</div>

Mohammad wrote:

> map.connect ‘/mypage/mypage.html’, :controller =\> “mypage”, :action =\>  
> “mypage”

is there a way to do that where in the first argument of  
‘/mypage/mypage.html’, something like ‘/:controller/:action.html’(which  
doesn’t work). I can use a variable of some sort. I do not want to  
re-map all of the pages on this site like that.
