Home
/
Domain Issues
/
WHOIS And Domain Management
/
How do I redirect one domain to another domain name?

How do I redirect one domain to another domain name?

There are few ways to redirect one domain to another:

Using Redirects in Site Tools

You can use Site Tools -> Domain -> Redirects to create the desired redirects.

Via .htaccess

Add the domain you want to redirect all traffic from as a parked domain in Site Tools -> Domains -> Parked Domains. Then open the .htaccess file located in the public_html folder of your website and add the following lines at the top of the file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301,NC]

and save the changes. Make sure to replace olddomain.com with the parked domain name and newdomain.com with your website’s domain name. This will redirect all visitors for all URLs on olddomain.com to the same URL on newdomain.com. For example http://olddomain.com/awesome-page will redirect to https://newdomain.com/awesome-page.

You can edit the .htaccess file using the Site Tools -> Site -> File Manager.

PHP or HTML redirects

Redirect your domains by creating a PHP or HTML index file in the document root folder of your domain. This article provides examples for both programming languages that will help you to complete that redirection.

Using CNAME DNS records

This DNS method will allow you to redirect your subdomains to other domains/subdomains (for example test.yourdomain.com to yourdomain.com).

To manage CNAME records, go to your Site Tools > Domain > DNS Zone Editor as long as your domain is pointed to your SiteGround hosting account.

Share This Article