0

I'm trying to migrate a multisite WP installation to a new server. The network consists of a simple parent site that redirects users to one of four subsites based on their location. E.g. if a user from the UK visits the site, they're redirected to the site.com/uk subsite.

Before the migration, each subsite's theme & plugin resources (images, css, js etc.) were available from the subsite's url, e.g. site.com/uk/wp-content/themes/uk-theme/images/image.svg. After migrating the site to the new server, the resources are no longer available from the subsite domains, but are available from the parent site's domain, e.g. site.com/wp-content/themes/uk-theme/images/image.svg. This is causing all the stylesheets, images & js for each subsite to 404.

The other issue is that, although the main multisite network admin is accessible (site.com/wp-admin/), the subsite's admin panels aren't accessible, and going to site.com/uk/wp-admin, for example, produces an ERR_TOO_MANY_REDIRECTS error.

I feel like the two issues might be linked somehow but I'm not sure. Does anyone know why this might be happening and how I might be able to fix it?

1 Answer 1

0

I don't know how the migration was executed, but here are some things that have caught me out in the past.

Files: Check the .htaccess and wp-config.php files. htaccess for a multisite should look something like this:

RewriteEngine On
RewriteBase /
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]

And wp-config.php should have extra lines defining constants:

define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
etc...

If they are already there, you could try reverting them to regular (non-multisite) versions and going through the process of converting to a multisite manually. That way you could be sure the files are correct as WP will generate the files and DB stuff automatically.

Database: The options table for each multisite install should contain correct site_url and home. The wp_blogs table (probably not wp_ in your case) needs to contain path for each install.

Hope some of that helps. Will add more if I anything comes to mind!

2
  • Thanks for your response. I added some of the lines from your .htaccess code as they were missing from mine (lines 6, 10, 11 & 12), but that caused the subsites to produce an error: Not Found - The requested URL was not found on this server. My wp-config already contains the lines you mentioned and I checked the options and blogs tables but they're all correct. Any ideas?
    – Ash
    Commented Jun 18, 2020 at 16:14
  • How do I go about converting them to regular sites and back?
    – Ash
    Commented Jun 18, 2020 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.