301 redirect is for when you have permanently moved a webpage and you want to redirect search engines and visitors to the new location. Pagerank is also passed on. You can use the following syntax inside a .htaccess file to create a 301 redirect
Code:
redirect 301 /old/old.htm http://www.you.com/new.htm
You can use a 301 redirect to deal with canonical issues too, which is where search engines see
www.domain.com and domain.com as two different locations and therefore give them seperate PR. By using a 301 redirect to redirect domain.com to
www.domain.com you are effectively combining the PR of the two URLs.
You can deal with this by putting the following in a .htaccess file
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
302 redirects are often used to take advantage of a google exploit. I won't go in to too much detail here, but their original purpose it to provide temporary redirection.
I don't see much use for 302s, stick to 301s!