RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+.site.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+).site.com(.*) http://www.site.com/$1$2