If you want to redirect from index.html or php to another website (only the main page).
1 2 3 | RewriteEngine on Redirect 301 /index.html https://google.com |
If you want to redirect a certain page from the old domain to the new domain (wordpress example, works the same for non wordpress websites)
2 3 4 | RewriteEngine on Redirect 301 /product-category/new-products/ http://google.com/ |
If you want to redirect all pages from the old domain to a new domain (website).
3 4 5 | RewriteEngine on Redirect 301 / http://google.com/ |
Here is an example of a htaccess file. Download it and edit it as you please.
The htaccess file needs to be placed in the root of you romain (by ftp).