I'm trying to redirect all pages and subdomains by preceeding them with a m. subdomain unless it starts with a m. yet it completely fails. where am I going wrong?
example.com or www.example.com -> m.example.com test.example.com -> m.test.example.com images.example.com -> m.images.example.com m.example.com -> Don't redirect m.test.example.com -> Don't redirect
RewriteCond %{HTTP_HOST} !^m([.].*)?.example.com$
RewriteCond %{HTTP_HOST} ^(.*)?.example.com$
RewriteRule (.*) http://m%2.example.com/$1 [R,L]