Blog · WebJi® India

Redirect a Domain to Another Domain

Quick answer: Point the old domain at the new one with a 301 so browsers and search engines treat the move as permanent. Use registrar forwarding, the cPanel Redirects tool, a Cloudflare redirect rule, or an .htaccess RewriteRule. Match the path as well as the domain, or every deep link lands on the home page.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Two domain names written beside a laptop showing a redirect rule in a hosting panel — redirect domain to another domain

301, 302 or masked: what each redirect code does

Point the old domain at the new one with a 301 so browsers and search engines treat the move as permanent. Use registrar forwarding, the cPanel Redirects tool, a Cloudflare redirect rule, or an .htaccess RewriteRule. Match the path as well as the domain, or every deep link lands on the home page.

Code or modeMeansUse it when
301Moved permanentlyA brand move or a merge. Search engines pass most signals to the new URL.
302Found, temporaryA campaign or a maintenance page. The old URL stays the canonical one.
307Temporary, method preservedA form POST that must stay a POST during a short move.
308Permanent, method preservedThe same as 307 but permanent. Rare outside APIs.
Masked / framedIframe with the old address in the barAlmost never. Two URLs show the same content, and ranking signals split.

If the move is real, use 301 and stop reading about the rest. The only common mistake after that choice is sending every URL to the home page, which is covered further down.

Four ways to redirect, and which one to use

Pick by where the domain's DNS and site already live. All four can deliver a 301; they differ in who applies it and what you can control.

MethodWhere it runsKeeps the pathBest for
Registrar forwardingAt the registrarSometimes, as an optionA domain with no hosting of its own
cPanel RedirectsOn the hosting accountWith the wildcard optionA site that already lives in cPanel
Cloudflare ruleAt the edge, before the serverYes, by expressionDNS on Cloudflare, no origin server needed
.htaccessOn the Apache or LiteSpeed serverYes, with $1Full control of every rule

DNS itself cannot send a 301. An A record or a CNAME only tells the browser where to look; the redirect is an HTTP response from a server. That is why "DNS redirect" is really forwarding done by the DNS provider's proxy, or a rule at the edge.

Registrar forwarding, step by step

This is the shortest route and the right one when the old domain has no hosting attached. The registrar answers the request and returns the 301 itself.

  1. Sign in at the registrar that holds the old domain, not the host of the new site.
  2. Open the domain, then the DNS or forwarding section. In most panels this sits next to the DNS records.
  3. Add a forwarding entry with the full destination, including https:// and the path if you want a specific page.
  4. Choose permanent (301), not temporary, and leave masking off.
  5. Add a second entry for the www hostname if the panel does not do it automatically, then save.

You know it worked when a request to the old domain returns a 301 with a Location header pointing at the new domain. The test command is in the last section.

cPanel Redirects and the .htaccess rule

cPanel has a Redirects screen that writes the rule for you. Domains, then Redirects. Choose the domain, type the path, paste the destination URL, tick the www box, pick Permanent (301), and save.

When you need the path carried across, write the rule yourself. This block sends every URL on the old domain to the same path on the new one, query string included:

  1. Open File Manager, enable hidden files, and edit .htaccess in the document root of the old domain.
  2. Add RewriteEngine On first, once, if it is not already there.
  3. Add the condition and rule: RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC], then RewriteRule ^(.*)$ https://new-domain.com/$1 [R=301,L].
  4. Save, then request an old URL and check that the Location header keeps the path.
  5. Delete any older Redirect line for the same domain, or the two rules fight and produce a loop.

For a single page, the shorter form is enough: Redirect 301 /old-page/ https://new-domain.com/new-page/. It does not carry query strings, which is fine for a brochure page and wrong for a shop.

Point each old URL at its new page

A domain move is a list of URLs, not one URL. Send the old home page to the new home page, and every page that has links or rankings to its closest equivalent on the new site.

  • Export the old sitemap and the top 100 landing pages from Search Console or analytics.
  • Write the map as two columns: old path, new path. Do it in a spreadsheet before you touch a rule.
  • Redirect section by section where the structures match, then handle the exceptions one line at a time.
  • Leave a 404 for pages with no equivalent rather than sending them to the home page, which search engines treat as a soft 404.
  • Keep the map for a year, because old links keep arriving long after the launch.

The same applies to the www and non-www forms, and to http versus https. Pick one canonical host and redirect the other three forms to it, or you will run four copies of the same site.

What happens to rankings, links and mail

A 301 passes most of the signal from the old URL to the new one, and search engines usually swap the result within days to weeks. It does not pass everything, and it does not pass it instantly, so a move always carries a short dip.

  • Keep the old domain registered and redirecting for at least a year, and longer if it still has backlinks.
  • Update the internal links, the sitemap and the canonical tags on the new site so they point at the new domain only.
  • Submit the new sitemap in Search Console and use the change-of-address tool where it is offered.
  • Redirect the mail separately: a domain redirect does not move MX records, so an old mailbox stops receiving unless you keep the mail service or forward the addresses.

That last point catches people mid-move. The website redirects, the invoices still go to an address on the old domain, and nobody notices until a supplier bounces.

When the redirect loops or drops the path

Test the response before you tell anyone the move is done. One command shows the status and the target, and it works from any laptop with curl installed.

  1. Run curl -I https://old-domain.com/any-page/ and read the first line: it should say 301, not 200 or 302.
  2. Read the Location header. It should name the new domain and the same path, not the new home page.
  3. Run the same command on http:// and on www. to confirm all four forms land in one place.
  4. If the first line says 301 but the Location points back at the old domain, you have a loop. Remove the duplicate rule.

ERR_TOO_MANY_REDIRECTS in a browser is almost always one of three things: an HTTPS rule pointing back at http, a www rule and a non-www rule chasing each other, or a redirect that rewrites the destination as well as the source. A redirect that drops the path is usually the single-page Redirect line where the RewriteRule block was needed.

WebJi® hosts the new site on cPanel hosting, where the Redirects screen writes the same rules you see above, and domains are registered or transferred from domain registration in India. If the old domain's DNS is still on another provider, changing nameservers is the step after the redirect works, not before.

Frequently Asked Questions

How do I redirect one domain to another domain?

Use a 301. Registrar forwarding, the cPanel Redirects screen, a Cloudflare redirect rule or an .htaccess RewriteRule all work. Pick the one where the old domain's DNS or hosting already lives, keep the path with a wildcard or $1, and test the response with curl -I before you announce the move.

Should I use a 301 or 302 redirect?

301 when the move is permanent, which is almost every brand or domain change. A 302 tells search engines the old URL is still the canonical one, so it fits a campaign or a maintenance page. Use 307 or 308 only when a form submission must keep its HTTP method.

How do I redirect without losing SEO ranking?

Map each old URL to its closest new page instead of sending everything to the home page, use 301, keep the old domain registered and redirecting for at least a year, and update internal links and canonicals on the new site. Expect a short dip while the search engines process the change.

How do I redirect specific pages, not just the homepage?

Write a rule that carries the path. In .htaccess that is RewriteRule ^(.*)$ https://new-domain.com/$1 [R=301,L] after a hostname condition. For a handful of pages, one Redirect 301 line per old path is clearer, but those lines do not carry query strings.

Can I redirect a domain without hosting it?

Yes. Registrar forwarding answers the request at the registrar, and a Cloudflare redirect rule works with a proxied placeholder record and no origin server at all. DNS alone cannot send a 301, so one of those two services has to answer the request.

How long should old-domain redirects stay live?

At least a year, and longer if the old domain still has backlinks or printed material in circulation. Keep the registration renewed while the redirect is live, because an expired domain stops answering and the redirect dies with it. Search engines also need time to drop the old URLs.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →