Posts Tagged ‘trick’

Website monitoring against hacking

Friday, February 20th, 2009

A brilliant idea codes from Google’s “Official Google Webmaster Central Blog“. If your site gets hacked you might not notice it until it’s to late. And it can be a lot of work to check your site each day.

So Google suggests to use Google Alerts to scan your site on a regular base for common malware terms by searching for something like “site:example.com viagra OR casino OR porn OR ringtones”.

It’s not a 100% solution but I’d say it’s pretty good and quick to set up.

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!