I'm having trouble tro redirect example.com
to www.example.com
and it's subdomain to www.test.example.com
to test.example.com
And currently i'm using this:
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^([^\.]+)\.([^\.]+)\.([a-z]{2,4})$
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]