Domain Mapping on a Multisite domain change

I have a multisite environment that has a primary domain (v3.domain1.ca) with a few sites under it (v3.domain1.ca/site1 and v3.domain1.ca/site2), and I used a second domain (v3.domain2.com) in the multisite using the built in 4.5+ domain mapping with a few sites under it (v3.domain2.com/site3 and v3.domain2.com/site4). Using Cpanel the, v3.domain1.ca and v3.domain2.com subdomains were directed to a folder v3 in the public_html folder. It worked beautifully.

This is a development site that will eventually be on the primary domain and not a sub domain, so in an effort to test moving the multisite, I changed the domain to the domain1.ca/v3 and domain2.com/v3 with the subsites being domain1.ca/v3/site1 ... etc. The site is in the folder public_html/v3, so it matches well.

Adjusted wp-config.php, .htaccess, database entries, removed subdomain redirect we are up and running... MOSTLY. Everything on the primary domain1.ca/v3 and subsites front end and admin work perfectly. Th

The problem is on the second domain domain2.com/v3, both admin and front end show correctly. But admin of the subsites domain2.com/v3/site3/wp-admin and domain2.com/v3/site4/wp-admin, both show the data for domain2.com/v3/wp-admin. The link at the top shows domain2.com/v3/site3/wp-admin but you get the actual admin page for domain2.com/v3/wp-admin ... weird. The front end shows a 404 on both site3 and site4.

I've compared the exact structure of the database entries in the working primary domain and second domain and they are the same. I cannot figure out where the settings that affect this are and what would prevent the second domains subsites from now working. Any help is appreciated!

    Adam Czajczyk

    Hello Evan,

    I hope you're well today and thank you for your question!

    The link at the top shows domain2.com/v3/site3/wp-admin but you get the actual admin page for domain2.com/v3/wp-admin

    If I understand your current setup correctly, there should be no such site so the "domain2.com/v3/wp-admin" would mean the "wp-admin" area of a main site of the network (site ID 1). Is it that or is that admin area of some other site?

    Have you also checked "Siteurl" and "Home" URLs values for these failing sites (e.g. domain2.com/v3/site3) on "Network Admin -> All Sites -> [Edit] link for the site -> Settings tab"? It looks to me like that might be the case of non-consistent configuration there.

    If that doesn't help, would you mind granting me a support access to the site so I could take a closer look? To do this please follow this guide and let me know here when it's enabled:

    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-4

    Best regards,
    Adam

    Adam Czajczyk

    Hello Evan!

    I checked the site and while I'm still not sure what is causing that I noticed that the "common point" of the sites that are not working is that they are sub-sites of an additional domain.

    While "domain1.ca" is the main domain of your WP install and "v3" seems to be a folder of that domain where WP is installed in, the main site is on "domain1.ca/v3" and sub-sites are in "domain1.ca/v3/sub-site" form. These sites work fine.

    The other that do not use "domain2.com" but also with "v3" folder. I'm wondering whether changing to just "domain2.com/sub-site" would help here. Is the folder "v3" for the "domain2.com" any physically existing folder on the server or is it just a path added in site's settings? Does the "domain2.com" point to the site via dedicated IP only or is it an add-on domain - if it's an "add-on" domain, where does it's root folder (document root) point to?

    Please advise!
    Best regards,
    Adam

    Evan T

    The entire multisite was in the physical public_html\v3 folder, and domain1.ca and domain2.com where both pointing to the main public_html\. It just seems that having the multisite (with multiple domains in use) in a subfolder and not on the html root causes domain mapping issues.

    So moving the site from the public_html\v3\ folder into public_html\ folder fixed the problem as expected and all sites work fine. This is fine since thats how it should be in the end, so ends my little experiment. Thank you for the help!