Rails: Multiple Sites (Multisites) in one Web Application


Did you know it is possible to host multiple sites in one web application? It’s actually quite easy! The one issue you will run into is with scaling it. This method is pretty simple, but it does not scale well. With some tweaks, you could overcome that, though. Here’s how you do it:

First, you will want to setup a basic route and a controller.


Finally, you will want to setup a different default layout for each of your sites.