I have a domain name lets say. mydomain.com and it has a hosting account. But I also have another domain name, mydomain2.com that doesnt have a hosting account. How can I make mydomain2.com go directly to mydomain.com? I am using Host Gator

Dani AI

Generated

Three practical ways to make mydomain2.com point to mydomain.com are registrar-level forwarding, DNS+server redirects, or adding the second name to the hosting account as an alias/parked domain. asked the original question; and pointed toward using the hosting control panel. The notes below expand the tradeoffs so the best choice is clear.

Registrar forwarding (no hosting required) is the quickest when mydomain2 has no hosting. Most registrars offer HTTP forwarding and let the owner choose permanent (301) or temporary (302). Avoid masked/framed forwarding — it hides the real URL, hurts SEO, and breaks HTTPS. Registrar forwarding usually leaves MX records alone, but check the registrar’s exact behavior.

If the hosting account can accept the second domain, point mydomain2’s A record to the host IP (or add it as an alias/parked domain) and configure the web server to issue a 301 redirect to the canonical domain. Example Apache .htaccess rule (placed in mydomain2’s document root) that redirects everything to the https version of mydomain.com:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?mydomain2\.com$ [NC]
RewriteRule ^(.*)$ https://mydomain.com/$1 [L,R=301]

Notes and common pitfalls: a CNAME cannot be used at the root/apex of a domain (use an A record or ALIAS/ANAME if supported). If users may visit , a valid TLS certificate for mydomain2 is required because the TLS handshake happens before any HTTP redirect. Using a 301 (permanent) redirect is best for SEO; parked domains that just serve identical content without redirect can create duplicate-content issues. After changes, allow DNS TTL to propagate and verify with a HEAD request (curl -I) to confirm the response is a 301 and the Location header points to the intended domain.

Recommended Answers

All 2 Replies

In Hostgator cPanel . You will have option called "Redirect Domains"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.