I’ve imported a multisite project into DevKinsta and set the multisite option appropriately (subdomain), but it will not allow me to visit any of the multisite domains locally, except for the primary domain.
I first get the wp-signup.php redirect error after DevKinsta imports the site when trying to login to the primary site, but I’ve found some support to get around that in the forum here by updating the URLs manually in the local DB.
I can access the WP admin of the primary site locally, but every time I try to get access to the secondary site locally, I get a generic “can’t connect/server not found” browser error. I tried downloading the Better Search Replace plugin to manually do a search and replace for the secondary domain in the local DB, but that didn’t seem to have any affect either.
I’ve also restarted the docker containers for DevKinsta. Not sure what I’m missing here. Is this a common issue? I’ve also attempting deleting the site and re-importing, but I end up in the same scenario.
So if you’re no longer getting the signup redirect error that means your database records should be correct.
The server connection errors are occurring because your machine’s hosts file does not have entries for your subdomains. For example, on Windows I would have to add the following in order for the subdomain to route correctly:
Hopefully that’s the only issue there. I do see that this isn’t as user-friendly as the subdirectory multisite process and have pointed it out to our developers. Hopefully we can streamline this a bit in the future.
Please let me know if that doesn’t work/if you start getting a new error.
Thank you for the response and guidance here @Kevin
I’m not sure where to find the subdomain for the secondary site to test this out. I’ve adopted this project without that context unfortunately. All that I know is that this secondary site is mapped to a different URL. Do you know where I could find the subdomain info? I’ve tried a few combinations in my hosts file, but nothing is working for me yet.
These are what the entries look like in my host file right now. I added the frenchdomain entries. When I try to access the french URL, it actually redirects me to the first DevKinsta site in my list for some reason…
Okay so I think I see the issue. So assuming the main domain for your multisite is something like mymultisite.local in order for the mapping to work, you will need to change all of your subsites from domains to subdomains.
They would all need to be changed to domains like firstsite.mymultisite.local instead of someotherdomain.local.
So it would be easiest to make the changes in a Kinsta Staging version of the site.
Go to your Network site list to check if your sites are actually subdomains or if they have their own domains (/wp-admin/network/sites.php)
If there are subsites using unique domain names that are not subdomains of the main site, you will need to run a Search and Replace for each site. For example, if one of your sites was https//google.com, you would need to run a search and replace for google.com to google.stagingdomain.com
Once you have the subdomains working on Kinsta Staging, you can then Pull that to DevKinsta. As of DevKinsta 2.4.0, you shouldn’t have to change the database or run a search and replace again at this point. All you will need to do is add all of the subdomains that are in your Multisite network to your hosts file.
I suggest doing all the search and replace stuff within MyKinsta/Staging first so our Live support team can help you out if you run into any issues!
By the way, pointing a domain to the localhost IP will just default it to your first website if NGINX can’t find a match for the domain in its configuration. The NGINX configuration will only contain multisite.local and *.multisite.local for the subdomains. There’s nothing there to route a custom domain to that specific multisite/WordPress installation.
Thanks @Kevin, I’m working through the process now to setup the staging version of the site, then I’ll run through these steps again and let you know if successful.