tags:

views:

46

answers:

1

I just moved my siteA.com to siteB.com. I am trying to put traffic from siteA.com to siteB.com.

My .htaccess file which 301 redirection does not work

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.siteA.com/home/3-Tips-in-Math.html$
RewriteRule ^/?$ "http://www.siteB.com/home/3-Tips-in-Math.html" [R=301,L]

How can you make the above code to work?

+1  A: 

Try this rule:

RewriteCond %{HTTP_HOST} !^www\.siteB\.example$
RewriteRule ^ http://www.siteB.example%{REQUEST_URI} [L,R=301]
Gumbo
Thank you! It works :)
Masi