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

WordPress 2 websites with common user database

Discussion in 'Misc WordPress Requests' started by jumpynew, Feb 22, 2018.

  1. jumpynew


    2 websites with common user database, by jumpynew

    Hi everybody
    I have such question.
    I m working on woocommerce + wc Market place+ BuddyPress (with custom fields) site and I want to have different subdomains of it (for different countries), but the common user database.
    I want my users to be able “to jump” from one site to another, if they need to search the products in other country.
    I was thinking about Multisite, but for this moment my hosting doesnt support such possibility.
    So, for now I have the main site with all settings, pluguins and demo data – “site.com”.
    I have found and tried to implement such steps:
    1. I have created sub-domain “ua.site.com” + folder on my hosting
    2. During the installation of wordpress for “ua.site.com”, I pointed the database of my main “site.com”. but with other table prefix
    $table_prefix = ‘ua_’;
    instead of
    $table_prefix = ‘wp_’; (from the main site)
    3. Then I added
    define(‘CUSTOM_USER_TABLE’, ‘wp_users’);
    define(‘CUSTOM_USERMETA_TABLE’, ‘wp_usermeta’);
    to the wp-config.php of ua.site.com

    4Then I added
    define(‘COOKIE_DOMAIN’, ‘.site.com’);
    define(‘COOKIEPATH’, ‘/’);
    to the wp-config.php of ua.site.com

    I was trying to accses admin ares of ua.site.com, but I have message:
    “You do not have sufficient permissions to access this page”.
    (I tried with different admin users and even created the new one)
    It seems to me, all good with my hosting settings..
    How can I fix this problem?
    I will be grateful for any tips!

    And one more thing. I have all these pluguins, like BuddyPress, which are connected with users profile, can it have negative impact with such settings?
    Maybe there are any others solutions to have my users on all sub-somains?

    Thanks a lot

    2 websites with common user database

Share This Page

Monarch Social Sharing Plugin