I have the following in my .htaccess file
# Force www
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
It was put there for SEO reasons to ensure that traffic to http://example.com was redirected to the www. address consistently.
I am now developing a subdomain and of course when I type in subdomain.example.com it helpfully directs me to www.example.com.
Can somebody help me get the syntax right so that only requests to http://example.com are redirected to www.example.com and not any other subdomains.