# Subdomain routing with rails 2

**URL:** <https://www.ruby-forum.com/t/subdomain-routing-with-rails-2/132339>\
**Category:** Rails\
**Created:** [March 19, 2008, 9:07am UTC](https://www.ruby-forum.com/t/subdomain-routing-with-rails-2/132339 "2008-03-19T09:07:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sucrenoir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e68b1a/32.png) [@sucrenoir](https://www.ruby-forum.com/u/sucrenoir)\
**Post date:** [March 19, 2008, 9:07am UTC](https://www.ruby-forum.com/t/subdomain-routing-with-rails-2/132339/1 "2008-03-19T09:07:33Z")

</div>

What is the best to route based on the subdomain in routes.rb ?

There used to be a plugin  
[http://svn.danwebb.net/external/rails/plugins/request\_routing/trunk/README](http://svn.danwebb.net/external/rails/plugins/request_routing/trunk/README)  
for rails 1.

But as the routing mechanism has been rewritten, what is the prefered  
way today ?

---

<div class="post-metadata">

**Author:** ![sucrenoir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e68b1a/32.png) [@sucrenoir](https://www.ruby-forum.com/u/sucrenoir)\
**Post date:** [March 19, 2008, 9:35am UTC](https://www.ruby-forum.com/t/subdomain-routing-with-rails-2/132339/2 "2008-03-19T09:35:58Z")

</div>

Jm Goem wrote:

> What is the best to route based on the subdomain in routes.rb ?
> 
> There used to be a plugin  
> [http://svn.danwebb.net/external/rails/plugins/request\_routing/trunk/README](http://svn.danwebb.net/external/rails/plugins/request_routing/trunk/README)  
> for rails 1.
> 
> But as the routing mechanism has been rewritten, what is the prefered  
> way today ?

Ok i just tested the request\_routing plugin and it works with rails 2.0  
🙂
