Sorry for such a messy question name. The bottom line is this.
Suppose there is a table in the database, in the table there is a field with a specific value, how to transfer this value to the third level domain.
For example: http://mysite.com/value display as http://value.mysite.com/
The page should be generated exclusively when requesting the database, without using files and folders where value will be the file (html, php, etc.) or a folder on the server.
I will add for clarity. There is a line in .htaccess
RewriteRule ^([a-z0-9-/]+)$ _construct.php [L] The result is a link http://mysite.com/value
how to implement the RewriteRule method so that http://value.mysite.com/ is equal to http://mysite.com/value and works the same.