#带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]
Last modification:April 12, 2022
如果觉得我的文章对你有用,请随意赞赏