"Local Router Error" message on multi-network instance

I managed to get local to “route” to the second network. For anyone interested (and future reference), I’ll illustrate how I achieved that.
(This applies to Macs only)

  1. Create a new WP multisite (subdomain) instance in Local (this will be the first/default site/network, for eg. example-a.dev)
  2. In the browser, visit example-a.dev/wp-admin and log in
  3. Be sure to have multi-networks enabled before carrying on.
  4. At this point, I can create example-a.dev subdomain sites (eg: sub1.example-a.dev, sub2.example-a.dev, etc)
  5. Create a new network (say, example-b.dev)
  6. If you try to browse to example-b.dev at this point, the browser will load the “Local Router Error” page (router-error.html)
  7. You can’t creat subdomain sites for example-b.dev at this point in time, but the network and default site will be registered
  8. In Finder or terminal, browse to ~User/[profile-folder]/Library/Application Support/Local by Flywheel/routes/
  9. Copy and paste the example-a.dev.conf and rename the copy to example-b.dev.conf
  10. Open the example-b.conf in your text editor of choice
  11. Find and replace any instances of “example-a.dev” to “example-b.dev” - except, perhaps, the ssl cert and key references.
  12. Save and close, then restart the example-a.dev instance in Local
  13. After that, it’s possible to browse to example-b.dev in addition to example-a.dev
  14. You’ll have to log in with the superadmin account when accessing example-b.dev/wp-admin
  15. From here on out, you can create subdomain sites (eg: sub1.example-b.dev, etc)
    If you want to create a new network, repeat steps 5 to 12 above.

Update & disclaimer: Not sure if this is a real fix, but some things are working. Would be great to get some validation from people in the know about this.

There are a few inconsistencies with this “fix”.

  • As far as I know, this works with subdomains multisite multinetworks, I haven’t had time to test for subdirectory multisite instances.
  • After step 12 above, I noticed that ability to “sync” multisite domains to hosts file had no effect. In fact, a previously synced subdomain went missing from the list of domains in the local hosts file.
  • Normally, each domain or network (and any associated sites or subdomains) added in WP is listed in the admin bar under the My Sites menu item. After implementing the above stated steps, this is no longer the case. The first domain/network/site and subdomains created before adding a network is now listed along with the very next site/domain/network added. Any other sites after this whole procedure do not show up in the admin bar, but are still displayed in the network admin backends and can be directly accessed via its URL.

Finally, I’m sure there is more wonkiness to be experienced, which I’ll post back here as and when I come across it. Again, Flywheel/Local community members and experts are more than welcome to chime in with their knowledge and expertise.

2 Likes