Hi! I’m trying to set up a multisite network, for creating multiple languages of a site. I can not get the path for the default site to be anything other than /wp/. Is this a common problem? Because I would like the default language to be english, I don’t mind having /en/ as the base path, but that does not seem to work either. Does anyone have a solution for this?
I’m also curious about this.
Hello everybody!
My first post is here just to fix this for others that might have this problem.
So the things you need to check are as follows:
- You have proper rewrite rules. In my case, I was on NGINX and wanted a sub-folder setup so I had to use the ones in the docs here: Bedrock: Server Configuration | Roots Documentation
you can find there all the other servers and versions there as well.
- Check that you have configured the correct
DOMAIN_CURRENT_SITE
constant in your application.php (or via env vars as you want). I used the settings offered here: Multisite setup?
I don’t really know why these are not in the official docs → they should be
- And the most important, the one that caused most issues for me, is the fact that on multisite, there is no more /wp/ in the wp-admin url, because the rewrite rules handles these.
And also, most importantly, in a multisite scenario, WordPress will no longer consider the wp-config.php constants for WP_SITEURL and WP_HOME. So these will not overwrite the ones in the DB. This means that WordPress will use the WP_SITEURL and WP_HOME that he finds in the wp_options
table. So on a clean WP Bedrock multisite install, these settings in wp_options
will both be configured as domain.com/wp
which will make your default site to have this /wp
ending.
So to fix this, if you already followed points 1 and 2, and you’re still seeing the /wp
ending for your default site, then go in your mysql and manually edit these options.
I used manual queries from command line like so:
update wp_options set option_value="https://domain.com" where option_id=1;
update wp_options set option_value="https://domain.com" where option_id=2;
In this case option_id=1 is siteurl
and option_id=2 is home
. This should be the case in all setups. Or you might use option_name=siteurl
and option_name=home
instead of option_id=1
and 2 respectively.