redirecting google bots user grant with .htaccess

i want to redirect old domin to new domin only for google bots and users can open the old url and use it as normaly
. i think i should use Rewrite in .htaccess but im not sure what is the code