The default .htaccess RewriteRule to redirect every multisite.com to www.multisite.com does not work properly.

If you have problems with it, leave the two lines uncommented, and add the following three lines for each multisite you set up:

 RewriteCond %{HTTP_HOST} mysite\.com$ [NC]
 RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
 RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]

Credit to Florian.

Alternatively, use this generic template.

# Non-empty HTTP_HOST in the request
RewriteCond %{HTTP_HOST} !^$ [NC]
# Does not start with 'www'
RewriteCond %{HTTP_HOST} !^www\. [NC]
# Saves the value of HTTP_HOST in %1
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
# Redirects using the saved URI (in RewriteRule) and saved hostname (in the last RewriteCond)
RewriteRule ^(.*)$ "http://www.%1/$1" [L,R=301]

Make sure your .htaccess file contains RewriteBase /drupal in front of any rewrite rules. Additionally, ensure that dots and slashes are properly escaped in your RewriteCond.

If you wish to redirect examples.com and www.examples.com to www.example.com, use these lines:

RewriteCond %{HTTP_HOST} examples\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

If you'd like to redirect domain.tld to www.domain.tld, but not other subdomains, use this.

#Redirect all users to access the site with the 'www.' prefix
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} !\.([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]