• magdaparis

    (@magdaparis)


    Hi,

    I’ve done some digging on this and can’t seem to resolve my problem…
    Basically, I want to run two separate blogs (content/themes/etc), which each have their own domain name, but need to share one mySQL database (my host only allows 1 database in my package…)

    With a root installation of wordpress, both https://www.domain1.com and https://www.domain2.com show the same content.

    I’ve tried installing wordpress in separate subdirectories off the root file ‘blog1’ and ‘blog2’, with both sharing the database using different prefix for each (‘wp1_’ and ‘wp2’). With this I am able to see Blog 1 by going to https://www.domain1.com/blog1 OR https://www.domain2.com/blog1 ; and blog 2 is accessible at https://www.domain1.com/blog2 or https://www.domain2.com/blog2.

    I want to know if it is possible to I install / edit wp-config so that these two blogs can run from independent domains directly from their root menus?

    While I ran a single blog with no problem for years, this second one is proving to be quite a challenge!!

    Thanks for your help!!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi

    (@esmi)

    Try changing the table prefixes on at least one of the installs in wp-config.php.

    briealeida

    (@briealeida)

    To esmi’s point, I’ve successfully used table prefixes.

    The relevant MySQL documentation for this appears to be here.


    Brie

    Thread Starter magdaparis

    (@magdaparis)

    Thanks — I’ve already set different prefixes in the table, so I know the data is separate, but how do I assign each domain to only fetch data with the correct prefix?

    Also, will i be able to run different themes on each blog?

    MichaelH

    (@michaelh)

    You set the $table_prefix in wp-config.php and that’s how each domain knows what “tables” to use.

    Thread Starter magdaparis

    (@magdaparis)

    but since both blogs share the same root menu, they are sharing the same wp-config…

    MichaelH

    (@michaelh)

    If they do share the same wp-config.php then you are doing some ‘coding foo’ in your wp-config.php to do that.

    aremkay

    (@aremkay)

    I have just tried to open a new WordPress site, and when I get to “install” in the admin subdir it gives mee a full page of error-messages.
    It appears that it may be a related issure to the one here. Diid I once have a blog on this root-domain? I don’t remember. I have 2 on another site completely (different root, user info, etc)
    Any help – most appreciated.

    Here is the first batch:

    “‘.__(‘Already Installed’).’

    ‘.__(‘You appear to have already installed WordPress. To reinstall please clear your old database tables first.’).’
    ‘);} $php_version = phpversion(); $mysql_version = $wpdb->db_version(); $php_compat = version_compare( $php_version, $required_php_version, ‘>=’ ); $mysql_compat = version_compare( $mysql_version, $required_mysql_version, ‘>=’ ) || file_exists( WP_CONTENT_DIR . ‘/db.php’ ); if ( !$mysql_compat && !$php_compat ) $compat = sprintf( __(‘You cannot install because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.’), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); elseif ( !$php_compat ) $compat = sprintf( __(‘You cannot install because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.’), $wp_version, $required_php_version, $php_version ); elseif ( !$mysql_compat ) $compat = sprintf( __(‘You cannot install because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.’), $wp_version, $required_mysql_version, $mysql_version ); if ( !$mysql_compat || !$php_compat ) { display_header(); die(‘”

    esmi

    (@esmi)

    @aremkay: Don’t highjack another poster’s thread. Post a new topic.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Two domains, different content, one MySQL’ is closed to new replies.