Custom module menu path renaming/redirection Is it possible to create path like subdomain for custom module menu?

For example create url like xyz.example.com if path is example.com/xyz where xyz is custom module menu.

I've already tried to use .htaccess file 

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$
RewriteRule ^xyz(.*) http://xyz.example.com/$1 [R=301,L]


It correctly changing url from example.com/xyz to xyz.example.com but xyz.example.com redirected me to HOME page of the site. 

I just want to change the url from example.com/xyz to xyz.example.com where module result will be displayed.

Thanks.

EDIT : My requirement is similar to this
You could modify $_GET['q'] during hook_boot(), something like the following.

function mymodule_boot() {
  $_GET['q'] = implode('.', array_slice(explode('.',$_SERVER['HTTP_HOST']), 0, -2));
}


There is probably a regex that could do the same as that explode/implode mess, but that does the trick to start with.