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