Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
WordPress Multisite SubDirectory #363
OS / ENVIRONMENT
I'm switching Devilbox over to be my primary development environment (and getting away from MAMP PRO). So far, everything has transitioned perfectly. WordPress and other applications have come over without issue.
WordPress Multisite, however, has thrown a wrench into the system. When creating a brand new WordPress Multisite with subdirectories (e.g., "http://example.com/subdirectoryname/wp-admin/") I am encountering a broken page. More specifically, I'm encountering "Too Many Redirects."
Initially, I assumed this was a WordPress multisite issue and took steps to diagnose WordPress myself. Multisite on Devilbox does work, allowing me to access my main site (http://multisite.loc) as well as the admin and network admin of the multisite (http://multisite.loc/wp-admin/ and http://multisite.loc/wp-admin/network/).
After confirming that Multisite was correctly configured (by setting up the same files on a remote development server), I have determined my NGINX configuration may need to be tweaked to accomplish subdirectory routing.
WordPress suggests this out of the box: https://codex.wordpress.org/Nginx#WordPress_Multisite_Subdirectory_rules
However, I have had no luck converting this CONFIG file into the nginx.yml file that Devilbox requires. I have a working vhost-specific nginx.yml working (/my/path/data/www/multisite/.devilbox/nginx.yml), and I have confirmed this file is working when restarting Devilbox (I can break routing, so it's loading the file correctly.
I'm hoping someone can use the multisite subdirectory rules and point me in the right direction to convert this to the yml file nginx will need.
STEPS TO REPRODUCE
Create a new vhost file
Use wp-cli to download and install a network:
Add your database information and then enable multisite:
Make sure you choose subdirectory and NOT subdomain.
After install, access the network settings page: http://multisite.loc/wp-admin/network/
Create a new site: "http://multisite.loc/testnetworksite/"
When attempting to access the subdirectory site or it's admin area the "too many redirects" error appears.
Devilbox version: Devilbox v0.15 (2018-08-18)
Just as a quick shot without much looking yet: https://devilbox.readthedocs.io/en/latest/vhost-gen/example-add-subdomains.html#complex-sub-domains-for-one-project
There was an issue here at Gtihub regarding Wordpress multisite. The above documentation is what was produced to make it work
Setup a WordPress Multisite:
WordPress recommended NGINX Rules:
I'm also around today if we can somehow hop on Discord or Gitter (which would you prefer) you can ask me any WP-related questions.
I'm also noticing a very odd thing that's happening while I'm trying to debug this. Here is what I'm seeing happen:
Not sure if this helps or leads you to another issue that could be wrong with my setup. Really appreciate the help!
The output looks correct, no issues. I am removing all installations and starting clean with only a "multisite" installation so I can debug without any other issues.
I sent a copy of the base WP Multisite install via a PM in Gitter.
WordPress also provides .htaccess settings when building the multisite (https://codex.wordpress.org/htaccess#Multisite) - maybe this could help in composing an example nginx.yml or other config files?
Hey there, I went ahead and switched over to the Apache side of things to get this working. Going to go ahead and close this. Appreciate you trying to help and for a great product! If I figure the Nginx portion out I'll be sure to post back here for anyone in the future.