In you main domain root directory a .htaccess files with
Code:
RewriteEngine ON
RewriteRule ^/subdomain/?$ http://subdomain.mydomain.com/ [R,QSA]
RewriteRule ^/subdomain/(.*)/?$ http://subdomain.mydomain.com/$1 [R,QSA]
And in the subdomain root directory a .htaccess files with
Code:
RewriteEngine ON
RewriteRule ^(.*)$ index.php?q=$1 [QSA]
(i haven't actually tested this so if there's a problem just ask)
Ps. remember to change subdomain in the first .htaccess file to your subdomain's name.