#带www的跳转至不带www域名
RewriteEngine On
RewriteCond %{HTTP_HOST} !^abc.com$ [NC]
RewriteRule ^(.*)$ http://abc.com/$1 [L,R=301]

#不带www的跳转至www域名
RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com [NC]
RewriteRule ^(.*)$ http://www.abc.com/$1 [L,R=301]

#更换域名全部301跳转到新站点
RewriteEngine on
RewriteRule ^(.*)$ http://www.abc.com/$1 [R=301,L]