我有一个域名www.domainA.com我想通过以下方式将其重定向到domainB。
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]