# Why use a Subdomain?

**URL:** <https://www.ruby-forum.com/t/why-use-a-subdomain/56418>\
**Category:** Rails\
**Created:** [March 31, 2006, 3:12am UTC](https://www.ruby-forum.com/t/why-use-a-subdomain/56418 "2006-03-31T03:12:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 3:12am UTC](https://www.ruby-forum.com/t/why-use-a-subdomain/56418/1 "2006-03-31T03:12:36Z")

</div>

New to Ruby on Rails. I’ve been playing around with an application I set  
up at [rails.foo.com](http://rails.foo.com).

Basically this means that all my pages tied to the application live on  
that subdomain. Is there any reason for not just installing onto your  
parent domain [foo.com](http://foo.com) and putting your static pages in the public dir  
that ruby on rails creates?

The answer seems like a simple yes, however all the install docs I  
looked at indicate a subdomain installation.

Why?

Thanks.

---

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 3:31am UTC](https://www.ruby-forum.com/t/why-use-a-subdomain/56418/2 "2006-03-31T03:31:31Z")

</div>

it’s not rails, it’s the webserver in front of it, which decides whether  
and  
where subdomains get mapped to.  
If your ISP handles the webserver at your [foo.com](http://foo.com) domain, then you have  
to  
stick to what you get, if you configure it yourself, then look out for  
the  
doc on how to do it propperly

---

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 3:36am UTC](https://www.ruby-forum.com/t/why-use-a-subdomain/56418/3 "2006-03-31T03:36:09Z")

</div>

I use subdomains because I can’t figure out how to get Lighty to map  
these two URLs to different document roots:

> **[.xyz Domain Names | Join Generation XYZ](https://gen.xyz/)**
>
> .xyz is for every website, everywhere.® We offer the most flexible and affordable domain names to create choice for the next generation of internet users.

> **[.xyz Domain Names | Join Generation XYZ](https://gen.xyz/)**
>
> .xyz is for every website, everywhere.® We offer the most flexible and affordable domain names to create choice for the next generation of internet users.

I’ve tried various combinations of conditionals in the config, to no  
avail. So instead I use [forums.xyz.com](http://forums.xyz.com). If anybody know how to do this,  
please share :).

Joe

---

<div class="post-metadata">

**Author:** ![d6veteran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@d6veteran](https://www.ruby-forum.com/u/d6veteran)\
**Post date:** [March 31, 2006, 3:49am UTC](https://www.ruby-forum.com/t/why-use-a-subdomain/56418/4 "2006-03-31T03:49:18Z")

</div>

I’m using Dreamhost.

I think Joe explains why I want to stick with subdomains.
