Set mod-rewrite to forward everything accept for one subdomain
Something like this should do it:

RewriteCond %{HTTP_HOST} !^(www|m)\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]