Domain name change, 301 redirect help needed

Hi,

My client just got a takedown notice b/c his domain had a trademarked name in it. Now we’ve got to point a new domain name at the old site. It’s a huge pr3 site that gets a ton of traffic and has a ton of links pointing at it.

Since the new domain and old domain are on the same server, is this the best way to redirect everything? I found this snippet of code on the net and it seems right but wanted the experts to weigh in before I flip the switch.

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\.newdomain\.com
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

thanks,

takayuki

I’d make a few minor changes:


Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^www\\.newdomain\\.com[COLOR="#006400"]$ [NC][/COLOR]
RewriteRule [COLOR="#0000CD"].?[/COLOR] http://www.newdomain.com[COLOR="#0000FF"]%{REQUEST_URI}[/COLOR] [L,R=301]

as it’s a bit more complete and efficient, but yours would have worked fine as well :slight_smile:

thanks for the tweaks and confirmation. :slight_smile:

takayuki