# Subdomain Fu Routing Question

**URL:** <https://www.ruby-forum.com/t/subdomain-fu-routing-question/146963>\
**Category:** Rails\
**Created:** [August 27, 2008, 3:23am UTC](https://www.ruby-forum.com/t/subdomain-fu-routing-question/146963 "2008-08-27T03:23:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowbird122](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Post date:** [August 27, 2008, 3:23am UTC](https://www.ruby-forum.com/t/subdomain-fu-routing-question/146963/1 "2008-08-27T03:23:24Z")

</div>

Hello-

I’m having some difficulty with Subdomain Fu (or my app, not to  
falsely accuse). I have two controllers: home and account\_root. I want  
the home controller to be used whenever someone goes to [www.myapp.com](http://www.myapp.com)  
and I want account\_root to be used if someone goes to  
[myaccount.myapp.com](http://myaccount.myapp.com). I set up the following routes:

map.account\_root ‘’, :controller =\> ‘account\_root’, :conditions =\>  
{ :subdomain =\> /.+/ }  
map.root :controller =\> ‘home’

This is similar to what was done in episode 123 of RailsCasts. The  
problem is that the condition doesn’t seem to be working. Regardless  
of what URL I go to, I always get sent to the account\_root controller.

Does anyone know what I might be doing wrong?

Regards-  
Eric

---

<div class="post-metadata">

**Author:** ![snowbird122](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Post date:** [September 27, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/subdomain-fu-routing-question/146963/2 "2008-09-27T23:43:19Z")

</div>

After banging my head on this same issue I found this:

[http://mbleigh.lighthouseapp.com/projects/13148/tickets/1-subdomain-route-conditions#ticket-1-6](http://mbleigh.lighthouseapp.com/projects/13148/tickets/1-subdomain-route-conditions#ticket-1-6)

The fix for me was to install it as a plugin in my Rails app, not as a  
gem.
