You keep asking the same question in different ways (this is the fourth or fifth post about the same question), and it’s seeming like this is an XY Problem. You’re asking about what you think a solution might look like, but you really need to take a step back, as the problem you need to solve isn’t really the one you think it is.
I’ve explained subdomains to you, which does the thing you’re trying to do (but probably should not be used). But, there are many other ways to solve your problem that don’t weird paths and manually munging configuration files.
Your apps do not need to be laid out like this, in the style of old cPanel subdomain paths. You can give each application its own virtual server (or sub-server) and home directory, which is more secure and easier to manage for stuff like backups.
Oh, you’re right! I’m sorry, I got you mixed up with another user. There are two people asking the same question multiple times.
Currently active threads about the same root problem (and trying to solve it in the same roundabout way):
A lot of folks migrating from cPanel this week, I guess.
The answer to all of them is the same: Don’t do that (unless you can’t avoid it, but it’s probably much easier to stop trying to avoid it and just configure your apps appropriately for the default file structure you get when you create a Virtualmin virtual server or sub-server).
To put it another way, you’re trying to do something quite complicated to avoid doing something that is almost certainly quite simple. Just update your apps to use relative paths, or the correct paths for Virtualmin’s default layout. It’s probably a one-line change. It is definitely much, much, simpler than all this mess with trying to change DocumentRoots to be in weird places, redirects, aliases with special handling, etc.
I’m coming from 2 different control panels that are not cpanel they have “binding” or child domain, make a child domain and you can set the path to point to so called /folder/ from that main domain “domain.com”, instead of making a new virtual domain blog.domain.com and putting the files in that virtual server.
Out of curiosity, which control panel(s) use “binding” in this way? I’ve never heard the term used this way. (And, I’m confused why it would be a desired feature.)