If I want to redirect the googlebot for one page which includes ?ref=xxx to another that does not, what would the code look like to do this, without redirecting any visitors.
Put this on your first line: if (preg_match("#(google|slurp@inktomi|yahoo! slurp|msnbot)#si", $_SERVER['HTTP_USER_AGENT'])) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.new-location.com/"); exit; } PHP: That will do it for a few other bots too, not just Google.
If you want to redirect googlebot only, ensure you're a little more specific than just a referrer that contains 'google'. Referrers can include mediapartners-googlebot, google-proxy, etc etc.
If Im redirecting traffic from index.php?ref=112 to index.php it redirects http://www.jrwrestling.com/catalog/index.php/cPath/42 to http://www.jrwrestling.com/catalog/index.php Does it not?