multiple sites on one code base and one database
I have been considering how I could implement multiple sites using the same code base and database and I've decided it won't be difficult to implement so I might as well do it.
I think I will create a SiteHosts table
HostName (i.e. localhost, www.joeaudette.com, www.mojoportal.com)
In IIS it would work with host headers and in apache using Virtual Hosts
The SiteID for a request would be determined by looking up the servername of the current request in the SiteHosts table, if no matching host is found the default site is served.
an interesting feature that will be needed to suport this will be enhanced role based security. We will need to differentiate between a Server Administrator and Site Administrator so that only Server Administrators can create new Sites and SiteHosts and also control what features are available in each site.