How do I redirect my site to another domain?

How do I redirect my site to another domain?

To login to your cPanel account, you can login via 

  • https://yourdomain.com.au/cpanel (your actual domain) or;
  • via MyToolbox.

Your cPanel username and password would have been sent to you in the email when you signed up with us, subject titled “New Account Information“. If you have misplaced this email, please contact us and we are happy to resend you this email.

To redirect your entire site to another domain, you’ll need to open the .htaccess file located in the root directory of your site.

You can access this by logging into cPanel using either of the methods outlined above.

Step 1: In cPanel under the Files heading select File Manager


By default, the .htaccess file is located under the public_html folder.

If the file is not visible to you, select Settings in the top right hand corner, and ensure that Show Hidden Files (dotfiles) is selected

.htaccess file should now be visible to you

Step 2: Right click on the .htaccess file and select Edit.

To impliment the redirect, add the following code to the .htaccess file:


<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^oldsite.com.au$ [OR]

RewriteCond %{HTTP_HOST} ^www.oldsite.com.au$

RewriteRule (.*)$ https://www.newsite.com.au/$1 [R=301,L]

</IfModule>


In the above example, if the person goes to www.oldsite.com.au/about-us, the person is redirected to https://www.newsite.com.au/about-us – Note $1 on line 5

If you would like any sub-pages to go to only one page on the new domain, you would need to modify the htaccess file:


<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^oldsite.com.au$ [OR]

RewriteCond %{HTTP_HOST} ^www.oldsite.com.au$

RewriteRule (.*)$ https://www.newsite.com.au/wehavemove [R=301,L]

</IfModule>


In the above example, If I go to www.oldsite.com.au/about-us, I will be redirected to the new domain on a specific page https://www.newsite

Last Updated September 7, 2023