301 Permanent Redirection using .htaccess file

If you want to redirect HTML and other web pages and if you have access to the .htaccess file of your website's server, you can make 301 permanent redirects to any URL.
Add the following lines of code in the beginning of your .htaccess file.

301 Redirect individual pages

Redirect 301 /oldpage.html http://www.example.com/newpage.html
Redirect 301 /oldUrl http://www.example.com/newUrl
After "Redirect 301" in the above lines, left side part refers to your old page or URL and the right side part contains your new page or URL. You can even redirect your pages to a page on another domain.

301 Redirect entire site to a new domain

RewriteEngine On
RewriteRule (.*) http://new.example.com [R=301,L]
Redirect 301 / http://new.example.com