Wildcard-subdomain with WordPress Multisite as Subdirectory

I have a WordPress multisite project and the multisite network is configured as subdirectory.

Let’s say – domain.com/site1, domain.com/site2 (which are working properly).

The server is also configured for wildcard-subdomain.

Read More

Now, if I try with req.domain.com or req1.domain.com/site1 or req2.domain.com/site2 then it always redirect to domain.com.

I checked the requested domain name (say for- req.domain.com) by print from <root dir>/index.php, and up to this /index.php the domain name (req.domain.com) is OK; but it redirected (to domain.com) before theme files start to execute.

Is there any way to use both wildcard-subdomain and multisite (subdirectory) simultaneously?

Related posts