Redirect all traffic to root of another domain

后端 未结 2 1996
醉话见心
醉话见心 2020-12-02 17:09

I have a domain that\'s not to be used anymore. I want to redirect all from http://www.old.com/ to http://www.new.com/, no matter what page the use

2条回答
  •  心在旅途
    2020-12-02 17:29

    Put this code in your ROOT .htaccess on www.old.com

    Options +FollowSymLinks -MultiViews
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^(www\.)?old\.com$ [NC]
    RewriteRule ^ http://www.new.com/ [R=301,L]
    

    This rule will externally redirect all www.old.com/* to www.new.com/

提交回复
热议问题