There are a number of published methods for hosting many sites on one WordPress install. But I thought I’d borrow the method that I’ve used with e107. This involves a simple modification to the config file.
By grabbing the domain using:
I then generate a database name based on what is passed in. There are many ways of doing that, a simple solution might be to use the domain name as a database name or if you only have a few sites you could just use a switch/case to load the config variables with the right values.
The beauty of a database driven site is that all it takes to turn your WordPress or e107 install into a new site is a change of database. It then helps to create a template once you have done your first install and setup up your favourite plugins etc. This means setting up a new site involves the creation of a new database and pasting in a script. Easy!
I will be exploring this idea further as I play around with my new sites. Watch this space.
Having worked with WordPress templates for the last few days, it is clear that e107’s template system is far easier to work with. The way wordpress has all the PHP embedded in the template files makes it really hard to work with. e107 manages to control an entire website from a couple of easy to use files. Changes can be made within the database using the excellent menu concept. WordPress just has to manage a couple of blog page styles but it seems to make much more of a fuss over everything.
It’s a shame e107 isn’t more widely recognised, but hopefully version 0.8 will fix all that…