Hi, what @flaviocopes suggests should work. I use a variant of that file on my production server. In your case mydomain.com will then be mapped to user/sites/mydomain.com.
As the above suggest, a subdomain is virtually a domain in its own right - it’s all about how the server interprets the domain for retrieving files from the server. I use grav.dev and test.grav.dev in local development, but the same setup would just as easily allow server.dev, server.com, server.net to be server from different (or the same) folders within sites - both locally and on my live webserver.