I just tested this on my local with a fresh subdmoain setup. Here’s my setup:
- Created
subdomain.test
- Added site:
demo1.subdomain.test
with the admin userdemo1
- Added site:
demo2.subdomain.test
with the admin userdemo2
Now, if I go to http://subdomain.test/wp-login.php
and login, I get the following results:
- User
demo1
logs in to http://subdomain.test/wp-login.php and is redirected to http://demo1.subdomain.test/wp-admin/ - User
demo2
logs in to http://subdomain.test/wp-login.php and is redirected to http://demo2.subdomain.test/wp-admin/
In short, WordPress already does this for you, assuming that the admin users for your subdomains are only admins for those sites.