I need to read these again. Went down MAMP alternative routes (including Valet, Trellis and VVV) and the ONE thing we could not get to work was having other users/employees on our network point to sites via their hosts file… then we gave up, hung our heads and texted MAMP our shameful booty call.
Related topic: Allowing for other machines on network to point to host machine that's using Trellis
Multisite with Bedrock and MAMP Pro Working!
In other news here’s how in full I have my MAMP Pro multisite set up working—hopefully this is helpful to others down the road!
/config/application.php
/**
* Multisite Network
*/
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
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);
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']); // for mapping other domains to sub sites (pointed new MAMP Pro hosts to same doc root
/web/.htaccess
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-(content|admin|includes).*) wp/$1 [L]
RewriteRule ^(.*\.php)$ wp/$1 [L]
RewriteRule . index.php [L]
Note: after getting this working the rewrites make the WP Admin path /wp/wp-admin
set back to /wp-admin/
. Still wondering if my rewrites aren’t quite right and/or if once of the env vars in /.env
should be updated?