With (blog\.)?
at the begin blog. becomes optional and so it will redirect only if it is different from blog.mysite.com
and mysite.com
.
RewriteCond %{HTTP_HOST} !^(blog\.)?mysite\.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
A different way to do the same would be:
RewriteCond %{HTTP_HOST} !^mysite\.com$ [NC]
RewriteCond %{HTTP_HOST} !^blog\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
Which means if hostname is different then mysite.com
and blog.mysite.com
redirect.
To avoid duplicity it is good to choose between www or non-www and redirect every thing for that.
So if u use www then redirect non-www to www and vice versa.