When you move your content from one page to another (when setting up a new website to replace the old, for example), one of the worst things you can do is to completely abandon your old site. This is especially true if your old site has good traffic or search engine rankings.
Placing redirect pages on your site can automatically move traffic, and search engine index bots, to the new page automatically. Redirection status codes tell search engines how to react to the relocated page, and using the right one is essential to not ditching your SEO in the move.
There are two types of redirects, the 301 and the 302, and each tells search engines different things. The 301 redirect tells search indexes that the page has been permanently moved to a new location. A 302 redirect is for temporary moves, for when you’ll be coming back to that page eventually. For example, if you have a temporary page up while you redesign your website, you would use a 302 redirect. Search engines would know not to update their indexes with the new address because it isn’t a permanent move.