[wp-trac] [WordPress Trac] #47630: Multisite: Admin dashboard links are malfunctioning on mapped domain

WordPress Trac noreply at wordpress.org
Sun Jun 30 07:03:32 UTC 2019


#47630: Multisite: Admin dashboard links are malfunctioning on mapped domain
----------------------------+-----------------------------
 Reporter:  kalico          |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  5.2.2
 Severity:  blocker         |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 I realize this may not qualify as a Trac issue. However, I have already
 tried the wp support forums, and read multiple pages of the wp forums,
 codex, stack exchange, etc. No one has an explanation for what I'm seeing,
 nor even do I find a similar description of it anywhere.

 Bottom line:

 Domain mapping on admin dashboard is not working as expected. The default
 (un-mapped) dashboard link for any mapped domain takes me to the primary
 site's dashboard. The mapped domain dashboard link takes me to a login
 screen.

 Background:

 About 10 days ago, out of the blue, “something” failed miserably on my
 production site. The primary symptom was that sites with a mapped domain
 were in a redirect loop on the front end.

 I had not done any updates or made any changes to the site. There were
 other symptoms at first, seemed causative. In retrospect, they may have
 been resultant or coincidental. I can explain if it is of interest, but I
 am trying to keep this brief.

 I was using the WPMUDEV Domain Mapping plugin, and it had been in place
 since the development of the site 3 years ago. I got the site working
 again by reverting to standard built-in WP domain mapping. However, the
 admin toolbar was missing (not the issue I am reporting today) and links
 to the mapped domain dashboards were malfunctioning.

 In my research, I have learned that some people who were using the MU
 Domain Mapping plugin (a different domain mapping plugin than I was using)
 experienced very similar issues around the same time. They also reported
 missing toolbars and redirect loops.

 For troubleshooting purposes, I created an exact duplicate of my
 production site with a primary domain of dev.xxxxxxxxxx.org and a mapped
 domain of dev.yyyy.org

 I assumed that I could work through a plugin conflict test and find out
 the cause. But after stripping the site down to bare bones, I still have
 the same problem.

 I cannot say for sure that it is a bug -- it may very well be something
 with my site. But I simply do not know where else to turn at this point. I
 need advice from those who know domain mapping best and might be able to
 identify what the root cause of this problem is.

 You can see a screencast demonstrating the problem here:

 https://cl.ly/7eee36f3aa13

 You can see screenshots of my folder structure and database entries here:

 http://bit.ly/2Jbm2fT

 Here are my site specs:

 - Multisite
 - WP 5.2.2 ( was on 5.1 with several out of date plugins when the original
 "out of the blue" problem happened and updated to 5.2.2 during
 troubleshooting)
 - AWS hosting
 - Apache/2.4.18 (Ubuntu)
 - PHP 7.0.33-0ubuntu0.16.04.5
 - multisite is in the webroot
 - subdirectory multisite setup
 - All plugins, mu-plugins, and drop-in plugins are moved into temp
 folders.
 - All sites are set to Twenty-Nineteen theme.
 - Domain mapping (using wp in-built options) for two domains, mapped to
 two of the subsites
 - On the frontend, domain mapping works as expected.
 - In the dashboard, domain mapping is NOT working correctly.
 – it was originally set up with the WPMUDEV Domain Mapping plugin (which
 is now legacy b/c of domain mapping since wp 4.5)
 – auto updates disabled

 I expect:

 My Sites >> [Mapped Site] >> Dashboard
 - should take me to the dashboard for that site (not any other)
 - I should not need to login because I am already logged in as superadmin

 What happens:

 My Sites >> [Mapped Site] >> Dashboard
 - I am taken to a login screen and my superadmin login returns a "wrong
 email or password" error
 - If I manually change the URL to the non-mapped URL for the dashboard
 (primarydomain.com/zzzzz/wp-admin), I am immediately taken to the primary
 site's dashboard instead.

 There is no 301/302 redirect.
 There are no errors in the apache error log.
 There are no errors in the WP debug log.
 The browser console shows no errors.

 I have tested this by creating a new sub-site and mapping the domain there
 instead. When I do this, the newly created test site's dashboard is
 inaccessible, and I am taken to the primary domain's dashboard. Now I can
 get to the previously mapped domain's dashboard easily, via the My Sites
 menu. This is demonstrated in the screencast above.

 Relevant portions of wp-config:

 {{{
 /* Multisite */
 define( 'WP_ALLOW_MULTISITE', true );
 define('MULTISITE', true);
 define('SUBDOMAIN_INSTALL', false);
 define('DOMAIN_CURRENT_SITE', 'dev.xxxxxxxxxx.org');
 define('PATH_CURRENT_SITE', '/');
 define('SITE_ID_CURRENT_SITE', 1);
 define('BLOG_ID_CURRENT_SITE', 1);
 // define('COOKIE_DOMAIN', '');
 // define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
 // define('DOMAINMAPPING_ALLOWMULTI', true);
 // define('FORCE_SSL_ADMIN', true);

 /* these were recommended for fixing a redirect loop, but they are not
 helping now */
 // define('ADMIN_COOKIE_PATH', '/');
 // define('COOKIE_DOMAIN', '');
 // define('COOKIEPATH', '');
 // define('SITECOOKIEPATH', '');

 /* baseline home and siteurl */
 define( 'WP_HOME', 'https://dev.xxxxxxxxxx.org' );
 define( 'WP_SITEURL', 'https://dev.xxxxxxxxxx.org' );

 }}}

 Relevant portions of .htaccess:

 (Keep in mind this is a copy of my production site, which does not have
 dev. in front of the domain name. Since the problem exists in both places
 identically, and given the use of the domain in these functions, I do not
 think it is relevant. Please correct me if I am wrong.)

 {{{

 # BEGIN HTTPS Redirection Plugin
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{SERVER_PORT} !^443$
 RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 </IfModule>
 # END HTTPS Redirection Plugin


 # Stop spam attack logins and comments
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{REQUEST_METHOD} POST
 RewriteCond %{REQUEST_URI} .*/(wp-comments-post|wp-login)\.php.* [OR]
 RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$ [OR]
 RewriteCond %{REQUEST_URI} ^(.*)?log-in(.*)$
 RewriteCond %{HTTP_REFERER} !.*xxxxxxxxxx.org.* [OR]
 RewriteCond %{HTTP_USER_AGENT} ^$
 #RewriteRule (.*) http://%{REMOTE_ADDR}/$1 [R=301,L]
 RewriteRule ^(.*)$ - [F]
 #RewriteRule ^(.*)$ http://xxxxxxxxxx.org/misc/block.html [R=301,L]

 # BEGIN WordPress
 <IfModule mod_rewrite.c>
 RewriteRule ^index\.php$ - [L]

 # add a trailing slash to /wp-admin
 RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

 RewriteCond %{REQUEST_FILENAME} -f [OR]
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^ - [L]
 RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
 RewriteRule . index.php [L]
 </IfModule>

 # END WordPress

 }}}

 I will be very grateful for any assistance you can provide in determining
 if there is something wrong with my site, or if this is a bug in WP. Thank
 you in advance!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47630>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list