.htaccess 301跳转

RewriteCond %{HTTP_HOST} !^(www.+|localhost|127\.0\.0\.1|.+?\..+?\..+)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]