Skip to content

Instantly share code, notes, and snippets.

@AustinWinstanley
Last active April 10, 2017 21:32
Show Gist options
  • Select an option

  • Save AustinWinstanley/cddd922ff982d0284270b60f70f657df to your computer and use it in GitHub Desktop.

Select an option

Save AustinWinstanley/cddd922ff982d0284270b60f70f657df to your computer and use it in GitHub Desktop.

Revisions

  1. AustinWinstanley revised this gist Apr 10, 2017. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions wp-config.php
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,9 @@
    *
    * @since 2.6.0
    */
    //
    // Use same Keys and Salts for both sites
    //

    /**
    * WordPress Database Table prefix.
    @@ -22,23 +24,21 @@
    * Everything below must be done on in primary and secondary wp-config.php with same values in both
    */

    // Create a shared cookie hash
    $cookiehash = md5("https://example.com/");

    // Use primary site user table
    /** Primary User table */
    define('CUSTOM_USER_TABLE','wp_users');

    // Use primary site user meta table
    /** Primary User Meta table */
    define('CUSTOM_USER_META_TABLE','wp_usermeta');

    // For base path. Add subdirectory if needed
    /** Base path */
    define('COOKIEPATH', '/');

    // For base path. Add subdirectory if needed
    define('SITECOOKIEPATH', '/');

    // Set the cookie hash
    define('COOKIEHASH', $cookiehash );
    /** Primary site domain with leading '.' */
    define('COOKIE_DOMAIN', '.example.com');

    /** Shared cookie hash */
    $cookiehash = md5("https://example.com/");

    // Primary site domain with leading '.'
    define('COOKIE_DOMAIN', '.example.com');
    /** Cookie hash */
    define('COOKIEHASH', $cookiehash );
  2. AustinWinstanley revised this gist Apr 10, 2017. No changes.
  3. AustinWinstanley revised this gist Apr 10, 2017. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions wp-config.php
    Original file line number Diff line number Diff line change
    @@ -27,13 +27,18 @@

    // Use primary site user table
    define('CUSTOM_USER_TABLE','wp_users');

    // Use primary site user meta table
    define('CUSTOM_USER_META_TABLE','wp_usermeta');

    // For base path. Add subdirectory if needed
    define('COOKIEPATH', '/');

    // For base path. Add subdirectory if needed
    define('SITECOOKIEPATH', '/');

    // Set the cookie hash
    define('COOKIEHASH', $cookiehash );

    // Primary site domain with leading '.'
    define('COOKIE_DOMAIN', '.example.com');
  4. AustinWinstanley revised this gist Apr 10, 2017. 1 changed file with 20 additions and 7 deletions.
    27 changes: 20 additions & 7 deletions wp-config.php
    Original file line number Diff line number Diff line change
    @@ -15,12 +15,25 @@
    * You can have multiple installations in one database if you give each
    * a unique prefix. Only numbers, letters, and underscores please!
    */
    $table_prefix = 'wp2_';
    $table_prefix = 'wp_'; // Primary site only
    // $table_prefix = 'ac_'; // Secondary site only

    $cookiehash = md5("https://example.com/"); // Use Site 1's URL
    /**
    * Everything below must be done on in primary and secondary wp-config.php with same values in both
    */

    // Create a shared cookie hash
    $cookiehash = md5("https://example.com/");

    define('CUSTOM_USER_TABLE','wp1_users'); //Change 'wp' to match the prefix set during
    define('CUSTOM_USER_META_TABLE','wp1_usermeta'); // Site 1's installation
    define('COOKIEPATH', '/'); //This path should reference Site 1's root
    define('SITECOOKIEPATH', '/'); //Should match 'COOKIEPATH'
    define('COOKIEHASH', $cookiehash );
    // Use primary site user table
    define('CUSTOM_USER_TABLE','wp_users');
    // Use primary site user meta table
    define('CUSTOM_USER_META_TABLE','wp_usermeta');
    // For base path. Add subdirectory if needed
    define('COOKIEPATH', '/');
    // For base path. Add subdirectory if needed
    define('SITECOOKIEPATH', '/');
    // Set the cookie hash
    define('COOKIEHASH', $cookiehash );
    // Primary site domain with leading '.'
    define('COOKIE_DOMAIN', '.example.com');
  5. AustinWinstanley revised this gist Apr 10, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions wp-config.php
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,8 @@

    $cookiehash = md5("https://example.com/"); // Use Site 1's URL

    define(CUSTOM_USER_TABLE,'wp1_users'); //Change 'wp' to match the prefix set during
    define(CUSTOM_USER_META_TABLE,'wp1_usermeta'); // Site 1's installation
    define('CUSTOM_USER_TABLE','wp1_users'); //Change 'wp' to match the prefix set during
    define('CUSTOM_USER_META_TABLE','wp1_usermeta'); // Site 1's installation
    define('COOKIEPATH', '/'); //This path should reference Site 1's root
    define('SITECOOKIEPATH', '/'); //Should match 'COOKIEPATH'
    define('COOKIEHASH', $cookiehash );
  6. AustinWinstanley created this gist Apr 10, 2017.
    26 changes: 26 additions & 0 deletions wp-config.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    /**
    * Authentication Unique Keys and Salts.
    *
    * Change these to different unique phrases!
    * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
    * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
    *
    * @since 2.6.0
    */
    // Use same Keys and Salts for both sites

    /**
    * WordPress Database Table prefix.
    *
    * You can have multiple installations in one database if you give each
    * a unique prefix. Only numbers, letters, and underscores please!
    */
    $table_prefix = 'wp2_';

    $cookiehash = md5("https://example.com/"); // Use Site 1's URL

    define(CUSTOM_USER_TABLE,'wp1_users'); //Change 'wp' to match the prefix set during
    define(CUSTOM_USER_META_TABLE,'wp1_usermeta'); // Site 1's installation
    define('COOKIEPATH', '/'); //This path should reference Site 1's root
    define('SITECOOKIEPATH', '/'); //Should match 'COOKIEPATH'
    define('COOKIEHASH', $cookiehash );