1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Multiple WP blogs on one DB and one engine

Discussion in 'Blogging' started by uno25, Jan 27, 2009.

  1. uno25

    uno25 Newbie

    Joined:
    Dec 22, 2008
    Messages:
    17
    Likes Received:
    3
    With this simple mod you can host unlimited blogs in one directory on your server and use one common MySql DB.

    First of all you have to mod your wp-config.php file. Add this

    Code:
    $prefix = $_SERVER["HTTP_HOST"];
    $prefix = str_replace('www.', '', $prefix);
    $prefix = str_replace('-', '', $prefix);
    $prefix = str_replace('.', '', $prefix);
    $table_prefix = $prefix.'_' ; //'wp_';
    instead of default

    $table_prefix = 'wp_'; //

    Upload wp files.

    To install first blog go to domain1.com/wp-admin/install.php
    It will create MySql tables starting from domain1.com_* so you can be sure they are unique.

    Now go to your hosting panel and add a new domain pointing to domain1.com
    In Plesk - Domain Aliases
    cPanel - Parked Domains

    Install your second blog domain2.com/wp-admin/install.php
    It will create tables starting from domain2.com_

    You can use different templates for each blog.

    If your hosting provider allows you to use only one domain but unlimited parked domains you still can host unlimited blogs.
     
  2. armaan

    armaan Registered Member

    Joined:
    Nov 10, 2008
    Messages:
    81
    Likes Received:
    9
    Look like good idea but I am little confused.
    Did you tried it yourself.
     
  3. iamsgf

    iamsgf Regular Member

    Joined:
    Oct 6, 2008
    Messages:
    307
    Likes Received:
    268
    ok, I do it slighty different:

    If you create a default folder called /wordpress/ and upload your wp installation to it, then remove the /wp-content/ folder.

    Then you create your blog folders like so:

    /wordpress/blog1/
    /wordpress/blog2/ etc etc

    Then you create shortcuts to the main files at /wordpress/ less for the wp-config.php & /wp-content/

    So each time you want a new blog you just copy all the shortcuts in the new dir. Then when you install just change the prefix.

    The best thing about doing it this way is that you will only ever have to update 1 wordpress install and every blog is updated.

    The purpose behind not linking ithe /wp-content/ is that you may want different themes or plugins for each blog. And it makes it easier when it comes to moving individual blogs, or blog flipping.
     
  4. masterwaldo

    masterwaldo Registered Member

    Joined:
    Jul 3, 2008
    Messages:
    95
    Likes Received:
    49
    Why don't you use wp-hive plugin?

    You can have multiple wordpress blog with 1 installation also. Just activate the plugin and you are ready to go.
     
    • Thanks Thanks x 2
  5. cooooookies

    cooooookies Senior Member

    Joined:
    Oct 6, 2008
    Messages:
    1,008
    Likes Received:
    216
  6. matapples01

    matapples01 Regular Member

    Joined:
    May 15, 2008
    Messages:
    358
    Likes Received:
    208
    MU is nice and the concept is great. The shortcoming of it is that you literally stumble on a new time saving/money making plugin weekly and the developers typically focus on getting them to work with "traditional" WP, not necessarily focusing on its interoperability with MU.