Redirects 301 & 302
Redirects, as the name indicates, are used to redirect a particular website, links etc to some other website. Now this can be achieved in two ways:-
301 Redirects: This refers to the permanent redirect, i.e. once this code is added in .htaccess, then all the links pointing to that site will automatically land to the destination site permanently.
E.g. To redirect all links on or pointing to http://www.domainname.com/ to https://www.domainname.com/, then this procedure is normally achieved by 301 Redirects
302 Redirects: This refers to temporary redirect , i.e. once this code is assed in. htaccess, then all the links pointing to that site will automatically land to the destination site temporarily. Doesn’t really help in SEO.
E.g. This method is normally used for Vanity Url’s