Domains and DNS

Redirect secondary domains to a main domain

Reviewed on 2 min read redirects domains

Scenario

We have a main domain, which we will call example.com, and two secondary domains called example.net and example.org.

The goal is for both the .net and the .org domain to redirect the user to the .com domain.

Prepare the domains

First, check that the domains to be redirected resolve to this hosting. They can use our nameservers or records set up with another provider; they do not need to have the same nameservers as the main domain.

If the domains are not registered directly with hostsuar, you will need to carry out these checks in your domain provider's panel.

Configuration

  1. Go to cPanel > Domains and click Create A New Domain.
  2. Enter one of the secondary domains. If it is only going to redirect, it can share the document root; save and repeat with the others.
  3. Open cPanel > Redirects and select Temporary (302) to check the configuration; use Permanent (301) when the destination has been validated and the change is final.
  4. Select the secondary domain and enter the full URL as the destination, for example https://example.com/.
  5. Choose whether the redirect should apply with and without www. Turn on Wild Card Redirect if you want to keep the path, so that example.net/seccion ends up at example.com/seccion.
  6. Save the redirect and check both variants of the domain before repeating it for the others.

Check the pages that were already getting visits

Test the secondary names over HTTP and HTTPS, with and without www. Each origin needs a valid certificate so HTTPS visits can reach the redirect.

If one of those domains had a different website, do not send all its pages to the home page without reviewing their content. Keep paths only when there is an equivalent page, and prepare mappings for the rest. Keep the origin domains registered for as long as you need to serve their links and redirects.

You may also find useful

Something wrong or out of date? Tell us and we will review it.