Multisite setup?

I can’t find any documentation on setting up multisite under bedrock; only for trellis – which isn’t working for a bedrock/sage only setup.

I feel that I shouldn’t have to modify more than the .env and /config/application.php to get this working.

Any help/insight?

Those are the only two Bedrock files you gotta modify. In fact, you don’t really have to modify .env at all. Just application.php.

This should be all it all that’s required, I think:

/**
 * Multisite Network
 */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false); // obv switch this to true if you're using subdomains
define('DOMAIN_CURRENT_SITE', env('DOMAIN_CURRENT_SITE') ?: parse_url(WP_HOME,  PHP_URL_HOST));
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

You also have to set up your rewrites, of course.

If you’re still having issues, check to make sure that WordPress didn’t do something super duper “helpful” like add the multisite stuff to the wp-config in your document root (bedrock/web/wp-config.php). lol

So what are the custom rewrites? That’s likely the issue im facing here because I have zero issues installing wpmu outside of bedrock.

Subdomain or subfolder install? What webserver - Apache or Nginx?

apache – subdomain.

WordPress provides you with the .htaccess rules you need when you go to setup multisite. Have you implemented those? Did you not see them? Have you not tried looking for them?

Let us know what you’ve tried to do to troubleshoot this.

I think this will work.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-.*.php)$ wp/$1 [L]
RewriteRule ^(wp-(content|admin|includes).*) wp/$1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
1 Like

This gives us: AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary.

I tried to work with RewriteBase /wp/ which dont gives this LimitInternalRecursion but I am unable to make it stable. Can someone help me how we can RewriteBase correctly to /wp/ with apache?

I am trying this setup:

   RewriteEngine On
     RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
     RewriteBase /wp/
     RewriteRule ^index\.php$ - [L]

     # add a trailing slash to /wp-admin
     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

     RewriteCond %{REQUEST_FILENAME} -f [OR]
     RewriteCond %{REQUEST_FILENAME} -d
     RewriteRule ^ - [L]
     RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
     RewriteRule ^(.*\.php)$ $1 [L]
     RewriteRule . index.php [L]
1 Like

I still have the same questions that I had in November 2016 with this reply:

And for posterity, this was also reported today as an [invalid] bug to Bedrock, and then moved to the docs repo

In the future, don’t submit a bug report to one of our repos when you don’t get an immediate response to a support request on here.

WordPress provides .htaccess rules for their default folder structure.
Bedrock is changing this structure and moves WordPress into /wp of docroot. I think that’s the reason you added nginx multisite rules in your docs I suppose. I love bedrock and I have no problems with single setups. But I am working on a big multisite project that struggle with the errors I mention with everything I tried all those years. I just kindly ask you for help to find out the correct rules for the minority of us who can’t switch easily to nginx yet.

Could this example Trellis multisite setup be of use?