cPanel
- Log into cPanel.
- Find a Domains section and click on Redirects.
- Select Permanent (301) as a type of redirect.
- In the next field, enter the domain you want to redirect. Or choose **All Public Domains**, if you want to redirect all domains on the server.
- In the field Redirects to, enter the domain you want to redirect yours to.
- Select the corresponding parameters for the redirect (most common choices are Redirect with or without WWW and Wild Card Redirect).
- Click Add.
ISPmanager
- Log into ISPmanager.
- In WWW section, select WWW-domains. It will open a window with a domain list.
- Select a domain you want to redirect from.
- Click on the Redirects button. You will be transferred to the page with a list of redirects.
- Click on Add, to add a redirect.
- In the Path field, enter the address you want to redirect from.
- In the Code field, select «301 – Moved Permanently».
- In the URL field, enter the address of the page you want to redirect to.
- Click ОК.
FTP (editing .htaccess manually)
- Connect to your website’s FTP server.
- Create an .htaccess file in the root directory (if it is already there — open it).
- Enter the following lines into it, replacing http://example.com/ with a domain you want to redirect from, and http://example2.com/ with a domain you want to redirect to.
- Save the file
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^http://example.com/ [NC] RewriteRule ^(.*) http://http://example2.com//$1 [L,R=301]
Now, you will have to fix robots.txt, because Yandex Web Search, which is very popular in Russia, has a tendency to misunderstand the domain redirect and may announce your new website a duplicate.
- Open the robots.txt (if there’s none — create it in the root directory).
- Enter the following lines into it:
- Save the file.
User-agent: Yandex Disallow: Host: http://example2.com//