Domains and DNS
Redirect secondary domains to a main domain
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
- Go to cPanel > Domains and click Create A New Domain.
- 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.
- 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.
- Select the secondary domain and enter the full URL as the destination, for example
https://example.com/. - Choose whether the redirect should apply with and without
www. Turn on Wild Card Redirect if you want to keep the path, so thatexample.net/seccionends up atexample.com/seccion. - 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
- Redirect a domain without ordering hosting Shows how to send a domain without hosting, a specific path or all its URLs to another destination f...
- Choose the www or non-www version and redirect the other Set up a 301 redirect between the www and non-www versions, keep paths with a wildcard and order the...
- Load another website in an iframe Shows how to load another website inside an iframe while keeping the visible domain, which file to c...
- Redirect a domain while keeping certain folders Provides ModRewrite rules to move a domain to another address without affecting an intranet or other...
Something wrong or out of date? Tell us and we will review it.