# One Rails application running 100 distinct websites

**URL:** <https://www.ruby-forum.com/t/one-rails-application-running-100-distinct-websites/89469>\
**Category:** Rails\
**Created:** [March 20, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/one-rails-application-running-100-distinct-websites/89469 "2007-03-20T18:43:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/48db29/32.png) [@ntk](https://www.ruby-forum.com/u/ntk)\
**Post date:** [March 20, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/one-rails-application-running-100-distinct-websites/89469/1 "2007-03-20T18:43:17Z")

</div>

I’m hoping to find someone who realizes the implications of this design  
strategy.I am attempting to build an application that can run 100  
different  
distinct domains. (not a [subdomain.domain.com](http://subdomain.domain.com) but  
_[www.domain.com](http://www.domain.com)_[http://www.domain.com/](http://www.domain.com/)  
).  
My strategy is to create an http request that looks like \*  
project.controller.action.keyvalue\* and pass this throughout the  
application. The “Project” record holds the particulars of each distinct  
domain.  
Each view has .rhtml code that fills the readable areas with \<%=“#{  
table.row.field}”%\> and there is ZERO hardcoded text. Our views would  
list  
their elements like:  
link\_to: #{table.row.columname}  
:Project =\> project  
:Controller=\>controller  
:Action=\> action  
:Id =\> id  
I know this ‘shifts’ away from the accepted DNN Rails paradigm, but  
didn’t  
DNN ‘shift’ when he designed Rails?I am grateful to hear if anyone is  
pursuing this direction.  
Thank you,  
David

---

<div class="post-metadata">

**Author:** ![ntk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/48db29/32.png) [@ntk](https://www.ruby-forum.com/u/ntk)\
**Post date:** [March 20, 2007, 6:51pm UTC](https://www.ruby-forum.com/t/one-rails-application-running-100-distinct-websites/89469/2 "2007-03-20T18:51:18Z")

</div>

David,

I pursued this direction already and created an internal CMS that  
takes it one step further: there are no file system (FS) view files,  
everything is int he DB. Basically you end up with one controller and  
one method for everything. I had to do some monkey patching but it  
works and it is hosting some sites that have decent traffic. I must  
say, though, that Rails is a little bit too big in features for such a  
direction so I am evaluating other implementation of the publishing  
layer. Nevertheless, the admin site is in Rails and uses much of the  
features that Rails has built-in. Write me off-list if you are  
interested in more details.

Sincerely,

Adrian M.

On 3/20/07, David K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> link\_to: #{table.row.columname}  
> Thank you,  
> David
> 
> >

–  
Adrian Esteban Madrid

---

<div class="post-metadata">

**Author:** ![ntk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/48db29/32.png) [@ntk](https://www.ruby-forum.com/u/ntk)\
**Post date:** [March 20, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/one-rails-application-running-100-distinct-websites/89469/3 "2007-03-20T21:53:46Z")

</div>

If you are using a Proxy server (like Apache) you could use Proxy  
Passthrough  
and Proxy Reverse (not sure of spelling here) for each of the domain VH  
entry.  
This way you can create your Rails app with normal routes and URLs like  
:controller/:action/:id

– Long  
[http://MeandmyCity.com/](http://MeandmyCity.com/) - Free online business directory for local  
communities  
[http://edgesoft.ca/blog/read/2](http://edgesoft.ca/blog/read/2) - No-Cookie Session Support plugin for  
Rails
