WordPress.org

Ready to get started?Download WordPress

Forums

Two Blogs on one DB (3 posts)

  1. HershelSR
    Member
    Posted 8 years ago #

    This thread:

    http://wordpress.org/support/topic/20117

    discusses creating two separate blogs which share one database. I have used the solution presented there of using one database with two options tables. I have one blog setup using:

    http://www.scarabbooks.com/us/quoteaday/

    and the other:

    http://www.scarabbooks.com/uk/quoteaday/

    The home page for each one works perfectly. The content is the same and the links are all within their respective directories. The /us/ site furthermore works fine--all subsequent pages work.

    The /uk/ site, however, doesn't work. Once you view a page beyond the home page (any page it seems) the links all revert back to the /us/ site.

    In the admin site for /uk/ I see:

    WordPress address (URI): http://scarabbooks.com/uk/quoteaday

    Blog address (URI): http://scarabbooks.com/uk/quoteaday

    and in /us/ I see both values as:

    http://scarabbooks.com/us/quoteaday

    so I am a bit puzzled as to why the /uk/ site is not working.

    The wp-config files match for each blog and the wp-settings file has one change, for the uk site, that being this line:

    $wpdb->options = $table_prefix . 'ukoptions';

    where in the us site it's:

    $wpdb->options = $table_prefix . 'options';

    Anyone have any ideas as to what's going wrong?

    I tried to debug it and I added an 'echo' to wp-config in the uk blog and the home page shows it, but the subsequent pages do NOT show it. Their url is /uk/, yet the echo doesn't show up.

    Thanks.

  2. moshu
    Member
    Posted 8 years ago #

    You don't touch the wp-settings file; you have to modify this line in the wp-config file for each install:
    // Change the prefix if you want to have multiple blogs in a single database.
    $table_prefix = 'wp_'; // example: 'wp_' or 'b2' or 'mylogin_'

    If one is ukstuff_ make the other usstuff_.

  3. HershelSR
    Member
    Posted 8 years ago #

    Perhaps I wasn't clear. I don't want the content of the blogs (i.e. the entries) to be unique. I want both to have precisely the same data, just to reside in two different directories.

    Changing $table_prefix will create two separate blog content table sets, which is not what I want.

    I want an exact replica of the /us/ blog to be in the /uk/ directory.

    Hershel

Topic Closed

This topic has been closed to new replies.

About this Topic