WordPress Multisite determine the correct domain to be set as current/default domain when setting multisite in Local fresh installation

I am unsuccessfully trying to setup multisite with WordPress’s fresh setup(WordPress installed in subfolder under htdocs of Localhost), but existing copy of Database already imported(provided by client).

Now the database already has atleast 15-16 different domain URLs already as entries of siteurl and home field in various wp_options tables for each site-domain.

And I want to use the same site-domains with little modifications to be able to work in Localhost WP multisite(like .com replaced with .local or so).

But even after doing all that and setting up multisite with following wp-config.php settings, when I try to access domain1.local, it tries to redirect to domain2.local like http://domain2.local/wp_signup.php?domain1.local and never redirects properly:

....
/* Multisite */
define('MULTISITE', true);
define('WP_ALLOW_MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'domain1.local');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
....

.htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*.php)$ $1 [L]
RewriteRule . index.php [L]

Can anyone help in figuring out what’s wrong here ?

Go to Source
Author: Vicky Dev

Multisite User Sync Question about blog authorship

I used to have a single wordpress site with a buddypress section (logged out visitors would see the blog only, but logged in users would see the buddypress area). I realised this was ineffective so i converted it to a multisite, where my “public” website was the root domain, and my “intranet” was at /team subdirectory. When I visit the network site admin, I see 190 users. When I visit the public website admin (which was the original site), I see 190 users. When I visit the /team subsite admin, I only see one user: me, the superadmin. Something looks odd, but I know that at the back-end, WP has only one users table so things should theoretically be fine.

  • The posts on my public website are written by people who register to be part of my intranet subsite.
  • The intranet should be the area where members can update their author bio, their profile image, etc. We also discuss new article drafts there.

My questions is: Should new members register on my main root site, or on the /team subsite. That is, should the “register/join our team” link point to http://main.com/register or http://main.com/team/register ? Does it make a difference? How do I configure the backend of my multisite so that there is only one blog, and all articles, drafts, etc are shared across my main site and my team site (for example, I want each member’s profile page on the team intranet to list all the posts that they have written for the public website).

Here is stuff that I have tried thus far (not working, and doesn’t answer my question above):

wp-config.php

define( 'WP_DEBUG', false );
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/wordpress2/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define ( 'BP_ROOT_BLOG', 2 ); // "2" is the team subsite $id

bp-custom.php

define ( 'BP_ENABLE_MULTIBLOG', true );
add_filter( 'bp_is_multiblog_mode', '__return_true' );

define ( 'BP_ROOT_BLOG', 3 );
add_filter( 'bp_get_root_blog_id', 'filter_root_blog_id' ); // return blog ID in

I also installed a plugin WordPress Multisite User Sync/Unsync but not sure if that solves my problem.

Go to Source
Author: Gaurav