Domain Mapping
-
Root Problem: When I am logged in as superadmin, I cannot reach the dashboard of any mapped domain site.
When I click on My Sites >> Unmapped Site >> Dashboard, I get to the appropriate Dashboard. This works as expected.
However, when I click on My Sites >> Mapped Site >> Dashboard, I am asked for a login, even tho I am superadmin.
If I skirt around this and enter the default URL with the site slug, it does not work. I end up at the primary site’s dashboard.
I have read that this login redirect problem is a cookies issue, but I have had no luck with those solutions. And it does not explain why the URL for the mapped site dashboard is taking me to the primary/default site’s dashboard.
Here are the details of how I got here…
I have a multisite that has been in place for about 3 years.
– it has several subsites
– it uses subdirectories (subdomains set to false)
– two of the sites have a mapped domain
– it was originally set up with the WPMUDEV Domain Mapping plugin (which is now legacy b/c of domain mapping since wp 4.5)
– I had auto updates disabled and was on version 5.1(?) when this happened (now on 5.2.2)About 10 days ago, out of the blue, “something” failed miserably. I did not do any updates or make any changes to the site. There were other symptoms at first, which in retrospect seem somewhat coincidental but they may have been causative. When the smoke cleared and I got my site working again, there was an admin toolbar problem (not the issue I am reporting today) and a problem with links to the mapped domain dashboards.
I have since learned that other people who were using the MU Domain Mapping plugin experienced very similar issues around the same time.
I set up a test site. It was created as an exact copy of the original, so the database is the same, but
– all plugins have been moved to a temp folder
– all mu-plugins have been moved to a temp folder
– all drop-in plugins have been moved to a temp folderStill, with all these things eliminated, the admin-side mapping is not working correctly, as described above.
The default WP domain mapping instructions simply say to put the mapped domain into the URL field on the Sites >> [Site] >> Edit first screen. This changes siteurl and homeurl to the same value.
It also makes the Dashboard URL in the My Sites menu mapped domain also: e.g., https://dev.nroc.org/wp-admin. However, when I use that link, I am faced with a login screen. My superadmin login does not work.
But by using the default domain, with the site slug in it (https://dev.nrocnetwork.org/nroc/wp-admin) I do get to the Dashboard without a login. However, it is not the Dashboard of the mapped domain site /nroc/. It is the Dashboard of the primary/default network site (ID 1)
I can work around this by manually setting the siteurl to https://dev.nrocnetwork.org/nroc, so that the links in the My Sites menu are usable. But really all this does is save me the trouble of typing the URL manually. It doesn’t really solve anything.
I tested further by creating a new subsite, and mapped my extra domain to that site. The same thing happens. I can now get to the admin dashboard for the site I want to get to! But the domain is not mapped to it, so on the front end, the site is broken.
I have included what I think are the relevant constants from wp-config below. I have fiddled with various constants to fix this. None of them have had an effect. You can see what I have tried, and what is currently commented in and out.
/* Multisite */ define( 'WP_ALLOW_MULTISITE', true ); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); define('DOMAIN_CURRENT_SITE', 'dev.nrocnetwork.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.nrocnetwork.org' ); define( 'WP_SITEURL', 'https://dev.nrocnetwork.org' );
I think there must be some core configuration error here, maybe something wrong in the database. I actually have a vague memory of this issue occurring during the setup of our site, but I apparently “fixed” it. This all makes me suspect that the issue was there all along, but masked by something — perhaps the domain mapping plugin.
To that end, I tried reinstating the plugin. It did not fix the issue. But ultimately I want to fix whatever is at the root of this, not mask it with a plugin again.
I will be grateful for any assistance! Thank you.
The page I need help with: [log in to see the link]
- The topic ‘Domain Mapping’ is closed to new replies.