What is the exact difference between these two in their function? results? Is one better than another? RewriteCond %{HTTP_HOST} !^www\.sitename\.com [NC] RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^sitename\.com [NC] RewriteRule ^(.*) http://www.sitename.com/$1 [R=301,L]
I think the first one says that if the url IS NOT www.sitename.com then change it to www.sitename.com. The second one says if the url IS sitename.com then change it to www.sitename.com. The problem with the first one would be if you had subdomains. Since subdomain.sitename.com doesn't match www.sitename.com it would be changed. So I think the first one would cause a problem with subdomains.