For websites hosted in either dedicated server or a shared web hosting server, you use 301 redirects in redirecting a single html page or an entire website.
Here’s and example of redirecting a single page/html page:
Redirect 301 /oldpage.html http://www.example.com/newpage.htmlFor a whole website, you can use 301 redirect in this manner:
Redirect 301 / http://www.example.com/There are other use of the 301 redirect on a web sites. Here are other use of it:
Changed file extension
Redirect web site with ‘www’ to not having one.
vice versa of the previous example.
Redirect example.com/index.php to example.com/
So next time you moved your web site content from one web hosting server provider to another or moving your site to a new domain name, you can definitely use the 301 redirect.
This is simple configuration you can make it into your Apache configuration file.