How do I redirect an existing website with htaccess without redirecting major robots?
To temporarily test sales on a newly redesigned site (that resides on sub.domain.com) without disrupting my existing search engine rankings I would like to redirect all visitors that aren't a major crawler to the new subdomain. The existing site contains the product ID (SKU) at the end of the product page URLs after an underline character, "_". I would like to redirect visitors that enter on a product page to the newly redesigned product page with the structure, http://sub.domain.com/toy/sku-[Product ID]?a=test . All others (including visitors that enter on category pages) I would like to redirect to the home page. Is this a good .htaccess file for this task?
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} !^(AltaVista|Googlebot|msnbot|Slurp)
RewriteRule ^_(.*)$ http://sub.domain.com/toy/sku-$1?a=test [R=302,L]
RewriteCond %{HTTP_USER_AGENT} !^(AltaVista|Googlebot|msnbot|Slurp)
RewriteRule (.*) http://sub.domain.com/ [R=302,L]