Tuesday, February 06, 2007

Multiple domains - one application

On Grovr - I recently implemented a feature I'm pretty happy about. I can now support multiple domains. Normally, this is pretty trivial, but I wanted the 'root' site to be tied to the domain. So all uplinks for any site within the domain would link "up" to the correct site and the root site would show the right site.

For examples of this check out and Both point to the same ip address, but I look to see what the domain of the current request is, lookup that site (the object in the database) - if I find it, that becomes the root site. All other sites under this domain now link "up" to this site. Simple, but I can't say I've seen this anywhere before...

So - if you expand this out to it's ultimate conclusion - I should be able to host a significant portion of the internet (if not the whole thing) on grovr. All for $15 a month.


  1. Sounds good, can you give an overview of how you got multiple domains working, and how rails detected the different ones?



  2. Anonymous8:22 PM

    I second that. I'd also like to read about how you actually did it...