To create a .htaccess file with 301 redirection, connect via FTP to your hosting service and perform the following steps:
- Open a new file using a standard plain text editor (such as Microsoft® Notepad).
- In the text editor, type: Redirect 301 </pagename.html> http://<target web address>.
- Save this file as .htaccess. Ensure the default .txt extension is removed.
- Upload this file to the root directory of the hosting server via FTP and test it.
Where:
- </pagename.html> = is the file to be opened at the target URL.
- <target domain name> = is the URL to which the page is to be redirected.
Example:
- Redirect 301 /index.html http://www.planetdomain.com.