We’re setting up a WordPress Multisite in the latest Radicle build, but we’re having trouble getting subdirectories (and subdomains) to work.
While we’re able to add multiple sites, the WP files for each subdirectory site can’t be found on the frontend. For example:
GET https://website.lndo.site/subdirectory/wp-includes/css/dashicons.css?ver=6.6.1 net::ERR_ABORTED 404 (Not Found).
Additionally, we can’t access the WordPress subdirectory admin (https://website.lndo.site/subdirectory/wp-admin/), which results in ERR_TOO_MANY_REDIRECTS.
We’ve installed roots/multisite-url-fixer and configured the multisite as follows in radicle/bedrock/application.php:
Thank you for sharing your previous solution on Multisite Bedrock. I followed the steps, but unfortunately, the implementation isn’t working as expected.
Steps Taken
Custom Nginx Configuration
The URL you provided for the default Nginx config (https://github.com/lando/cli/blob/main/plugins/lando-recipes/recipes/wordpress/default.conf.tpl) is no longer available. Instead, I used the following from GitHub: Lando WordPress Default Config.
Adding Rewrite Rules
I added the following rewrite rules above the first location block in radicle/lando-config/default.conf:
did you finally make any progress with the Multisite/Radicle/Lando setup?
I failed at a very similar point ultimately with the ERR_TOO_MANY_REDIRECTS error.
We ended up developing locally on a Lando based single site which then deploys into a Multisite. Not pretty at all.
The day will come, when we’ll have to test actual Multisite features locally.
Pawel, take a look at this article I wrote about working with Multisite for Bedrock and Lando. I’m not sure if something specific to Radicle might cause issues, but with a stock Bedrock install you can tweak the application.php file to get the current domain from the server environment variables. You can also set up multiple domains in Lando by updating your recipe and adding all domains under a proxy > appserver configuration. This works as long as you have a finite number of subdomains where you can manually add them in the Lando file.
I added the following to the README.md as instructions.
1. Setup a WordPress site following the lando setup for [local development](#local-development).
2. In `.lando.yml` uncomment `# config:` in the config root node.
3. In `.lando.yml` uncomment `# vhosts: ".radicle-setup/lando/default.conf.tpl"` in the config# node.
4. In the `.lando.env` set `WP_ALLOW_MULTISITE=true`.
5. Rebuild your app with `lando rebuild -y`.
6. Open `WordPress Dashboard > Tools > Network Setup` and setup your network for a subdirectory install.
7. Copy the network configuration rules and assign them to each environment variable in the `.lando.env`.
8. Rebuild your app with `lando rebuild -y`.
9. Your Multisite is now up and running. You can add new sites in the WordPress dashboard.
After following configuration and the README it should work. If not then check another forked version of multisite-url-fixer instead.
Hope this helps!
Greetings,
Lex
PS: Still wish this was integrated in Radicle by default for WordPress. Would be much easier.
I forgot to mention the instruction to also add the multisite env variables to the .example.env for deployment. I edited my post and provided information in step 7.