Yes, it’s possible.
As I was coming over from Drupal to WordPress, one single feature that’s on Drupal but missing in WP is the ability to run multi sites using just one codebase. This is achieved while individual blogs are still treated as separate entities meaning all control panel, themes and plugins etc are unique to a blog i.e. independent of each other.
The benefits of this are particularly apparent when it’s time to do script maintenance or upgrade since there’s only one set of codes to worry about. If you have more than just one or two WP blogs, the ability to have a unified installation is truly godsend.
So for over 1 year using WP for most of my blogs, I was quietly hoping to find a way to achieve Drupal-like feature above.
Then one fine day as I was surfing for plugins, I came across Nerdaphernalia’s Virtual Multi Blog that offers a script (originally used as a plugin) that lets you create multiple blogs using domains and subdomains all out of just one installation. That makes me really really excited.
WARNING: Before you go ahead, doing this on live blogs will be too risky. I used my domains that lay dormant for testing and familiarization. Only then I convert my live blogs to this new setup. Still, do all this solely at your own risk and I will not be responsible for any outcome.
These are the steps in bullet points:
- Download the script
- Extract files
- Read the instructions – Hmm at first the installation doesn’t look that straight forward as the author is a programmer and leaves out lots of the basics. Nevertheless, I just keep cracking at it as this is my only chance to make my WP life a lot easier later. Suffer a little pain now for a lot more gains later – need to motivate myself (perhaps you too)
- Place the “multiblog” folder in the
- Move the
wp-config-vmb.phpfiles from “multiblog” to the directory in which you installed WordPress
- In the
mb-autoconfig.phpin a text editor. Input your database login information
- I proceed to advanced option as I plan to convert several blogs to use the multiblog system
mb-users.phpin a text editor. Populate
$vusersaccording to the instructions there. For this example we have:
$vusers = 'catblog.com';$vusers = 'dogblog.com';$vusers = 'mutts.dogblog.com';$vusers = 'catblog.com/celebrities/morris';$vusers = 'dogblog.com/fido';
- Save and close the file.
- Now this is a critical step. Create a symlink for the add-on domain in the root directory that points back to the root directory. I can’t help much here and my best advice is to go back to your hosting support and ask for help. If you’re on Bluehost, there’s one easy way out. Say your WP is installed under domainA.com and you wanted to share the codes with domainB.com. In your Control Panel V.11 go to Domain Manager-Add Domain. Enter your as domainB.com and under “Choose Addon Directory and Sub-domain” go for “Use an existing directory” and select “domainA.com”. So whenever someone accesses domainB.com, he/she will be taken to domainA.com and this is what we wanted as all WP installation is under domainA.com. Yeah, it’s not very clear I know but all we do here is to redirect domainB to domainA. If you’re on different hosting, the process may be different so go ask them.
- Tips: If you’re stuck, always read the multiblog-readme.htm within the download file or go to the author’s site for description and readers’ comments
- Now with your web browser, go to each blog and set things up as normal through WordPress. WAIT! If you intend to keep each blog using their own config and database files, SKIP this step and proceed to the next
- Go into the
wp-content/multiblog/config/directory and make a copy of
mb-config-sample.php. Rename it to
mb-config-VUSER.php(See below for how to determine the VUSER.) Open that file in a text editor and set the database information and, optionally, the
$table_prefix. If you use the same database for multiple blogs, you must set a different
$table_prefixfor each. If you don’t set
$table_prefix, it will be auto-configured.
If you use the “Easy Setup” method, then your VUSER is the domain or subdomain, plus directory if any, except that all non-alphanumeric characters are replaced with an understroke (‘_’), and any ‘www.’ is removed. (Non-alphanumeric = anything not a letter or a number.)
If you set up the
mb-users.php, then the current VUSER for a blog is whatever that value is, cleaned up as described in the previous paragraph.
For example: With “
mutts.dogblog.com“, the VUSER is “
mutts_dogblog_com“. For “
www.catblog.com/morris“, the VUSER is “
catblog_com_morris” and the config file is
mb-config-catblog_com_morris.php. (Note the difference between dashes and understrokes!)
- Now with your web browser, go to each blog and set things up as normal through WordPress. If you’re lucky, it may work out-of-box but if not go back through the instructions above until done.
That’s it! Hopefully you manage it ok so far. The truth is that it took me several trials before the whole setup worked. Pay special attention to database info in several config files that you have throughout the scripts. It’s also important to keep trying until you succeed and don’t ever give up. You’ll appreciate it and definitely it worth all the efforts.
It’s hard to accept that I finally have two WP blogs running side by side using just a single installation. OMG, it’s simply awesome!
Good luck and enjoy.
P.S. Stephen, your plugin is fantastic and thanks so much for sharing.