Hi All -
I’m testing the roots/bedrock multisite setup on a new wordpress install and I’m running into a redirect loop.
I have my sites setup as a directory and the primary site is set to /web.
I have created a sub site called “test”.
When I navigate to https://sandbox.local/web/wp/wp-admin it works fine.
When I try to edit my “test” site via the admin dashboard, wordpress redirects me to “https://sandbox.local/web/test/wp-admin/” and I get stuck in a redirect loop.
Any ideas as to what might be causing this? I suspect its an .htaccess issue, but i’m not sure.
.env
WP_ENV='development'
WP_HOME='https://sandbox.local/web'
WP_SITEURL="${WP_HOME}/wp"
DOMAIN_CURRENT_SITE='sandbox.local'
PATH_CURRENT_SITE='/web/'
application.php
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', env('DOMAIN_CURRENT_SITE'));
Config::define('PATH_CURRENT_SITE', env('PATH_CURRENT_SITE') ?: '/');
Config::define('SITE_ID_CURRENT_SITE', env('SITE_ID_CURRENT_SITE') ?: 1);
Config::define('BLOG_ID_CURRENT_SITE', env('BLOG_ID_CURRENT_SITE') ?: 1);
.htaccess
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /web/
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).*) data/root/web/wp/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$data/root/web/wp/$2 [L]
RewriteRule . index.php [L]