# Rails, routes & subdomains

**URL:** <https://www.ruby-forum.com/t/rails-routes-subdomains/140346>\
**Category:** Rails\
**Created:** [June 13, 2008, 3:52am UTC](https://www.ruby-forum.com/t/rails-routes-subdomains/140346 "2008-06-13T03:52:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![polomasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2bfe46/32.png) [@polomasta](https://www.ruby-forum.com/u/polomasta)\
**Post date:** [June 13, 2008, 3:52am UTC](https://www.ruby-forum.com/t/rails-routes-subdomains/140346/1 "2008-06-13T03:52:41Z")

</div>

I’ve tried a couple different things but can’t seem to get this to  
work.

As part of my app I have a blog that is run at [应用宝官网-全网最新最热手机应用游戏下载](http://myapp.com/posts)

I would like to be able to setup so that [blog.myapp.com](http://blog.myapp.com) points to that  
controller. Not sure how to configure the subdomain and my routes.rb  
to do this?

if someone can point me in the right direction I would appreciate it.  
Thanks

---

<div class="post-metadata">

**Author:** ![polomasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2bfe46/32.png) [@polomasta](https://www.ruby-forum.com/u/polomasta)\
**Post date:** [June 13, 2008, 11:15am UTC](https://www.ruby-forum.com/t/rails-routes-subdomains/140346/2 "2008-06-13T11:15:45Z")

</div>

polomasta wrote:

> I’ve tried a couple different things but can’t seem to get this to  
> work.
> 
> As part of my app I have a blog that is run at [myapp.com/posts](http://myapp.com/posts)
> 
> I would like to be able to setup so that [blog.myapp.com](http://blog.myapp.com) points to that  
> controller. Not sure how to configure the subdomain and my routes.rb  
> to do this?
> 
> if someone can point me in the right direction I would appreciate it.  
> Thanks

#in config/routes.rb  
map.connect ‘’, :controller =\> “posts”
