我有一个域名www.domainA.com我想按照以下方式将其重定向到domainB。.htaccess - 重定向域名
www.domainA.com
- >www.domainB.com
www.domainA.com/anything
- >www.domainB.com/rebrand
我怎么能在htaccess的做到这一点,我已经做了下面的代码,但它重定向到只有/rebrand/
。
RewriteCond %{REQUEST_URI} ^\/
RewriteRule ^\/$ http://www.domainB.com/ [L,R=301]
RewriteCond %{HTTP_HOST} ^domainA\.com$ [NC]
RewriteRule ^(.*)$ http://www.domainB.com/rebrand/ [L,R=301]