PDA

View Full Version : Advice needed redirecting 5000 pages from old domain to new domain .htaccess keep PR


phonemaverick
08-29-2009, 06:12 PM
from a branding standpoint we are changing domain names...
The result we are trying to achieve is redirecting 5000 pages from old domain to new domain, keep PR, SEO with Search Engines as this is a high traffic website.

What is the best way, do we need to create a .htaccess file with line-by-line url's from old domain to new domain?

We have Linux server with mod-rewrite enabled and need advice on the proper .htaccess file we need to add in our root directory. From our research the best way to get search engines to acknowledge this domain change and preserve our SEO is:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?OLD\.com$ [NC]
RewriteRule .* http://www.our_new_domain.com%{REQUEST_URI} [R=301,L]

or

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

Alternately, we've found this in a forum as a line-by-line redirect:

Redirect permanent /old_domain_page/004.htm http://www.our_new_domain.com/old_domain_page/004.htm
Redirect permanent /old_domain_page/005.htm http://www.our_new_domain.com/old_domain_page/005.htm
Redirect permanent /old_domain_page/006.htm http://www.our_new_domain.com/old_domain_page/006.htm
Redirect permanent /old_domain_page/007.htm http://www.our_new_domain.com/old_domain_page/007.htm
Redirect permanent /old_domain_page/008.htm http://www.our_new_domain.com/old_domain_page/008.htm
Redirect permanent /old_domain_page/009.htm http://www.our_new_domain.com/old_domain_page/009.htm
Redirect permanent /old_domain_page/0010.htm http://www.our_new_domain.com/old_domain_page/0010.htm

Which way do we go? What is the absolute best way to achieve our migration from our old domain to new domain.

Many thanks,

clunk.werclick
09-13-2009, 11:04 AM
I'm probably being stupid, but could you just not add the old domain as an alias in the Apache configuration of the new domain, making sure the dns A record for the old domain pointed to the new?

Similar to this where 'experimental' is an alias to experiment (exceprt);
<VirtualHost *:80>
DocumentRoot /home/www/experimental/htdocs
ServerName experiment
ServerAlias experiment experimental

If the pages follow the same order, you should be OK, even with absolute links - as this will resolve back to the alias.
Like I say, I may be being stupid here and missing something glaringly obvious with the approach.

suejoh
09-15-2009, 11:56 PM
I expect you have already seen this...
http://en.wikipedia.org/wiki/Server-side_redirect
It seems to have some very straightforward code.

Just that when I asked a hosting company if they could redirect my site I was told - absolutely and I was to ask (in this case ) for a 303 redirect.

Sue

charlesandrews
09-30-2009, 03:08 PM
If you are doing a permanent migration you will want 301 over 303, through the amount of difference it makes is probably negligible.