Redirect subdomain to CakePHP action
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*).myserver.com$ [NC]
RewriteRule ^(.*)$ http://myserver.com/m/%1/$1 [L]
</IfModule>
RewriteCond %{HTTP_HOST} ^([^.]+).myserver.com$ [NC]
RewriteRule (?!^m/$)^.*$ http://myserver.com/m/sites/%1%{REQUEST_URI} [NC,L,P]