Archive for the ‘blogging’ Category

Tree development

Tuesday, March 23rd, 2010

No, not talking about trees in the terms of computer science this time. Real ones. This blog is taking part in my “a blog, a tree” project. Just by blogging about this and using this button, a tree gets planted for this blog:
My blog has planted a pine tree.

If you have a blog, you’re invited to take part, too. No cost for you, I’m paying the bill here. So, if you’re having a feeling that you should do something for the environment, join it and get your blog a tree: A blog, a tree

Running multiple WordPress blogs with one installation

Wednesday, August 20th, 2008

When trying to run this blog with the same installation as my “Outlook and Sync blog“, I found out that this was more difficult than expected. WordPress doesn’t have a readymade feature for this, you have to do some tricks. And most of the tricks that I found were pretty difficult or involved several steps.

Here’s a trick that is easier. It requires that:

  • The different blogs should be on different domains or subdomains
  • The blogs should take up the entire (sub)domain (so they shouldn’t start in a subfolder)

Then it’s quite easy. Simply configure all the blog’s domains to point to the same WordPress installation folder. You can probably do this in the configuration panel of your webspace provider.

Now edit the wp-config.php:

Before:

$table_prefix  = 'yourblog_';

After:

$domain  = $_SERVER['HTTP_HOST'];
if (stristr($domain, 'yourblogname1'))
�  $table_prefix  = 'yourblog1_';
else if (stristr($domain, 'yourblogname2'))
�  $table_prefix  = 'yourblog2_';
else
�  $table_prefix  = 'yourblog_';

As a nice side effect you’re only needing one database instance for this (they’re often limited in rented webspace) and just have more tables in the same database. All blogs use the same installed files, but have different content and can have different layouts and activated plugins.

Happy Blogging!