If some page on the website is not existing, and you need to redirect it to another page or even the website then a user can use the .htaccess file for redirection without wasting a minute.
Redirect from a page/directory to another domain or the main domain:
Redirect from one page to another domain:
Rewrite Engine on
Redirect 301 /mypage.html http://example.com
Redirect from one page to another page
Redirect from a page/directory to another page
Redirect 301 /oldpage.html /newpage.html
so, when you open the URL example.com/oldpage.html, it would automatically redirect you to the new page such as example.com/newpage.html.
