This is my application.php file (part of it):
/* Multisite */
define(‘WP_ALLOW_MULTISITE’, true);
define(‘MULTISITE’, true);
define(‘SUBDOMAIN_INSTALL’, true); // Set to true if using subdomains
define(‘DOMAIN_CURRENT_SITE’, env(‘WP_HOME’));
define(‘PATH_CURRENT_SITE’, ‘/’);
define(‘SITE_ID_CURRENT_SITE’, env(‘SITE_ID_CURRENT_SITE’) ?: 1);
define(‘BLOG_ID_CURRENT_SITE’, env(‘BLOG_ID_CURRENT_SITE’) ?: 1);
My .env file (part of it):
DB_NAME=local
DB_USER=root
DB_PASSWORD=root
Thank you for your reply. Yes, indeed, I don’t have the DOMAIN_CURRENT_SITE in .env file,
however, it is set in application php, so it is basically the same as in .env: /* Multisite */ define(‘WP_ALLOW_MULTISITE’, true); define(‘MULTISITE’, true); define(‘SUBDOMAIN_INSTALL’, true); // Set to true if using subdomains define(‘DOMAIN_CURRENT_SITE’, env(‘WP_HOME’)); define(‘PATH_CURRENT_SITE’, ‘/’); define(‘SITE_ID_CURRENT_SITE’, env(‘SITE_ID_CURRENT_SITE’) ?: 1); define(‘BLOG_ID_CURRENT_SITE’, env(‘BLOG_ID_CURRENT_SITE’) ?: 1);
I tried to put it to .env but didn’t make any effect.
When I create the “main” website https://xxxxx.local, Local edits the hosts file adding there the: 192.168.75.100 xxxxx.local #Local Site 192.168.75.100 www.xxxxx.local #Local Site
In order to make second site work as a subdomain, I have to edit hosts file, manually adding the links for th subdomain: 192.168.75.100 subdomain.xxxxx.local #Local Site 192.168.75.100 www.subdomain.xxxxx.local #Local Site
Every time I restart the project in local, the hosts file is getting refreshed and these two lines disappearing. Do you know how to make it the way the links are always there?
Personally, I just click past the annoying warnings and I don’t let Local modify my hosts file. I think they should probably just have an option for those who want to manage their own hosts file.
Gas Mask is what I have used in the past. It detects applications trying to make changes to the hosts file, so that has always worked for me ¯\(ツ)/¯