301 redirecting only homepage, not subpages? Why?

Total Noob

Banned - By Request
Joined
May 10, 2009
Messages
2,446
Reaction score
2,732
I'm trying to 301 an old domain to a new domain.

This is the code I'm putting in .htaccess:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://newdomain.com/$1 [R=301,L]

However, that is only redirecting http://domain.com to the new domain, not any subpages like http://domain.com/contact.php. Google is still indexing http://domain.com/anysubpage.php.

Any ideas as to why this is happening?

Thanks,

Jared
 
how do u want to do it?
a.com = b.com
a.com/apage.html = b.com/apage.html

or

a.com = b.com
a.com/apage.html = b.com
 
Try this

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} \olddomain.com$
RewriteRule (.*) http://www.yournewdomain.com/$1 [R=301,L]
 
how do u want to do it?
a.com = b.com
a.com/apage.html = b.com/apage.html

or

a.com = b.com
a.com/apage.html = b.com

Looking to make every page from a.com redirect to the homepage of b.com. So the second option.

Try this

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} \olddomain.com$
RewriteRule (.*) http://www.yournewdomain.com/$1 [R=301,L]

Didn't work unfortunately :(
 
Try:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule  (.*)$    http://newdomain.com [R=301,L]

tested and works my end.

I'm trying to 301 an old domain to a new domain.

This is the code I'm putting in .htaccess:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://newdomain.com/$1 [R=301,L]

However, that is only redirecting http://domain.com to the new domain, not any subpages like http://domain.com/contact.php. Google is still indexing http://domain.com/anysubpage.php.

Any ideas as to why this is happening?

Thanks,

Jared
 
Back
Top