Sometimes you may need to redirect your website for various reasons. A web page may be redirected for several reasons. For example a web site might need to change its domain name, an author might move his or her pages to a new domain, or two web sites might merge.
There are actually several ways you can direct your visitor to another page. The simplest technique is to ask the visitor to follow a link to the new page, usually using an HTML anchor. The good thing is if some of the visitor's browsers are not compatible with automatic direction, then they can easily visit the desired webpage by simply following the link. It's better if you opt for a server redirect rather than a client redirect. This would be because a lot of spamming is possible and has been done in the past by using client redirects.
So there could be a risk of your website being omitted from various search engines' indexes. So an automatic redirect is more preferable. By automatic redirect, we mean that when the user is typing in the URL or the present web address, the address bar quickly changes to the new website address and your viewers are immediately placed on the new page without even realizing it unless they look at the address bar. You should also perform a permanent redirect if you want your website in the search indexes. They often have the older/outdated domain names and links in their database and will send search users to these old URLs.
By using a "moved permanently" redirect to the new URL, visitors will still end at the correct page. 301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".