# Virtual Host issue

**URL:** <https://www.ruby-forum.com/t/virtual-host-issue/165808>\
**Category:** Rails\
**Created:** [April 17, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/virtual-host-issue/165808 "2009-04-17T18:08:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 17, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/virtual-host-issue/165808/1 "2009-04-17T18:08:27Z")

</div>

Hey, I’m having sort of an issue configuring virtual hosts with  
passenger

I want [domain.com](http://domain.com) and [www.domain.com](http://www.domain.com) to point to one rails app (simple  
cms)  
and \*.domain.com to point to another rails app (the actual thing)

How can I do this with apache+mod\_rails? Thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 17, 2009, 6:16pm UTC](https://www.ruby-forum.com/t/virtual-host-issue/165808/2 "2009-04-17T18:16:41Z")

</div>

> I want [domain.com](http://domain.com) and [www.domain.com](http://www.domain.com) to point to one rails app (simple  
> cms)  
> and \*.domain.com to point to another rails app (the actual thing)
> 
> How can I do this with apache+mod\_rails? Thanks a lot for your help!

I’m pretty sure if you first put the VirtualHost for [domain.com](http://domain.com) and  
[www.domain.com](http://www.domain.com), and then the VirtualHost with ServerName \*.domain.com,  
that  
should work.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 17, 2009, 6:33pm UTC](https://www.ruby-forum.com/t/virtual-host-issue/165808/3 "2009-04-17T18:33:43Z")

</div>

Thanks, my config was right, but the order in which the virtual host  
files were loading was wrong

On Apr 17, 11:15 am, “Brandon O.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
