Bedrock multisite setup in wordpress with sub directories doesn't work, redirect loop

Hello there! :slight_smile:

I’m currently trying to set up my wordpress multisite.
Unfortunately, the dashboard links for the subpages do not work. I end up in a redirect loop.

The domains should be as follows:
test.local
test.local/website1
test.local/website2

I installed the roots/multisite-url-fixer plugin to fix the network links. That worked well (Example: http://test.local/wp-admin/network/ => http://test.local/wp/wp-admin/network/).

test.local/website1 + test.local/website2 end up in a redirect loop.
Domain example: http://test.local/website1/wp-admin/ --> Redirect loop to same URL

If I add a /wp to the site URL and home URL in /wp/wp-admin/network/site-settings.php for website1, I get the domain I want (http://test.local/website1/wp/wp-admin/), but wordpress then interprets this as a normal page URL of test.local and I end up in frontend.

Info:
WP installed in sub directory /wp (Bedrock),
local installation with docker,
apache server,
PHP 7.3

This is my .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
RewriteRule . index.php [L]
</IfModule>

Config

/* Multisite */
Config::define('WP_ALLOW_MULTISITE', true);
Config::define('MULTISITE', true);
Config::define('SUBDOMAIN_INSTALL', false); // Set to true if using subdomains
Config::define('DOMAIN_CURRENT_SITE', 'test.local');
Config::define('PATH_CURRENT_SITE', '/');
Config::define('SITE_ID_CURRENT_SITE', 1);
Config::define('BLOG_ID_CURRENT_SITE', 1);

Does anyone have a solution for this?
Thanks in advance.

Best regards

Fixed by:
roots/multisite-url-fixer --> fixed the network links
for the sub sites: /wp should not be in the site url (only main site) --> fixed sub site links for frontend and backend

This topic was automatically closed after 42 days. New replies are no longer allowed.