To redirect traffic for all URLs of a domain to another with a permanent redirect (301) using a .htaccess file below are the steps.
- First, open a text editor, e.g. notepad, and create and save a file called .htaccess (be sure to change the file type to ‘All Files’ not ‘Text Documents (*.txt)’)
- Next enter the below code:
- Save the file and upload it to the root directory of the web server for the old domain
This should now redirect all traffic to any link that was on that domain to the same URL but with the new domain name.