301 Redirects

Google creates a problem when launching a new site on an existing domain; its existing catalog of URLs associated with the domain. Its mainly SEO that will take a hit as these URLs no longer exist. If anyone tries to access these link from the Google listing they will either be presented by a broken link or will be redirected to a 404 Error page. Not an ideal solution.

The easy solution is to put some 301 redirects in place in the sites .htaccess file. If you search Google with “site: youdomain.com”, it will list the results for that domain. These URLs should be matched up with matching or similar pages on the new site and targeted with 301 redirects (see below). The Google listing(s) will start to update for the new content on the site after it has been crawled a couple of times. This just limits the immediate impact.

RewriteEngine On

# 301 Redirects
RewriteCond %{QUERY_STRING}  ^$
RewriteRule ^about\.html$ /about/? [R=301,NE,NC,L]

RewriteCond %{QUERY_STRING}  ^$
RewriteRule ^contact\.html$ /contact/? [R=301,NE,NC,L]

# 301 Redirects (to subdomain)
RewriteRule foo(.*) http://foo.bar.com/$1 [L,R=301]