If a page on your website no longer exists, you can use the .htaccess file to redirect visitors to a new page or another website.
Redirect a specific page to another domain
Change the example page and domain to match the destination you want to use:
RewriteEngine on
Redirect 301 /mypage.html https://example.com Redirect an old page to a new page
Use the following format when both pages are on the same website:
Redirect 301 /oldpage.html /newpage.html Check the redirect
- Back up the existing .htaccess file before editing it.
- Use a permanent 301 redirect only when the move is intended to be permanent.
- Open the old URL after saving the file to confirm that it reaches the correct destination.