Domain Redirection – Complete Guide to All Methods and Step-by-Step Implementation

Published on
Belongs to Category: Hosting Knowledge|Posted by: Le Thanh Giang||11 min read
Facebook share iconLinkedIn share iconTwitter share iconPinterest share iconTumblr share icon
Domain Redirection – Complete Methods and Implementation Guide

What is Domain Redirection?

Domain redirection (also called URL forwarding) is a technique that automatically sends users from one domain name or URL to another. Instead of displaying content at the original address, the browser or server navigates visitors to a new destination — typically accompanied by an HTTP status code such as 301 (permanent), 302 (temporary), or other redirect types.

For example, when a user types oldcompany.com, they are automatically taken to newcompany.com without any extra effort. This ensures a seamless user experience and preserves your SEO rankings during transitions.

Learn about the differences between redirect types in our article on 301 vs 302 Redirect.

What is domain redirection?

When Do You Need Domain Redirection?

There are several real-world scenarios where domain redirection is essential:

  • Rebranding or changing your domain name: Your business changes its name and needs to redirect all traffic from the old domain to the new one. This is the most common case and requires a 301 redirect to preserve SEO rankings.
  • Migrating HTTP to HTTPS: After installing an SSL certificate, you need to redirect all HTTP traffic to HTTPS. Check out install free SSL Cloudflare and what is SSL.
  • Standardizing www vs non-www: Pick a single version (with or without www) and redirect the other to it. This prevents duplicate content issues.
  • Merging multiple websites: After acquiring or merging businesses, you need to consolidate several domains into one primary domain.
  • Marketing campaigns: Use short, memorable domains that redirect to long landing page URLs for easier advertising and tracking.
  • Changing URL structures: When migrating your website to a new platform, redirect old URLs to their new counterparts. Read what is Screaming Frog to find all URLs that need redirecting.
  • Temporary maintenance: Use a 302 redirect to send users to a maintenance page while you work on your site.

Domain Redirection Methods

There are multiple ways to implement domain redirection, depending on your technical skill level and infrastructure. Below are the six most common methods:


Method 1: Redirect via Domain Registrar

This is the simplest method, performed directly where you registered your domain. Most registrars offer URL Forwarding or Domain Redirect as a free feature.

How to set up on Namecheap

  1. Log into your Namecheap account, go to Dashboard > Domain List.
  2. Select the domain to redirect and click Manage.
  3. Under URL Redirect, click Add Redirect.
  4. Enter the details:
    • Host: @ (redirect the entire domain) or www.
    • Destination URL: The target URL (e.g., https://newdomain.com).
    • Redirect type: Choose 301 (Permanent) or 302 (Temporary).
    • Redirect style: Choose Frame (cloaking) or Not Framed.
  5. Click Save and wait for DNS propagation (typically 5-30 minutes).

How to set up on GoDaddy

  1. Log into GoDaddy, go to My Products > Domains.
  2. Select the domain to redirect, click DNS.
  3. Scroll to Forwarding, click Add.
  4. Enter the destination URL and choose the redirect type (301 or 302).
  5. Click Save.

How to set up on Hostinger

  1. Log into Hostinger's hPanel.
  2. Go to Domains > select the domain > Redirects.
  3. Enter the source path and destination URL.
  4. Select the redirect type and click Save.

Note: Registrar-level redirect works at the DNS level and doesn't require server configuration. However, it only supports whole-domain redirects, not individual URL paths. Learn more about what is DNS to understand how it works.


Method 2: Redirect via cPanel

If your hosting plan includes cPanel, this method offers more flexibility — you can redirect entire domains or specific paths.

  1. Log into your hosting cPanel (usually at yourdomain.com/cpanel).
  2. Find and click Redirects (under the Domains section).
  3. Configure the redirect:
    • Type: Choose Permanent (301) or Temporary (302).
    • Redirects to: Select the source domain.
    • Redirects to: Enter the destination URL.
    • Wild card redirect: If checked, all sub-paths will also be redirected.
  4. Click Add to save.

See also: What is cPanel for a complete guide to the hosting control panel interface.


Method 3: Redirect via .htaccess (Apache Server)

For users with technical knowledge and access to the .htaccess file on an Apache server. This method gives you granular control over individual URL redirects.

Open the .htaccess file in your website's root directory and add the following lines:

Redirect entire domain:

# Redirect entire old domain to new domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ https://newdomain.com/$1 [R=301,L]

Redirect specific URLs:

# Redirect a single URL
Redirect 301 /old-page.html https://newdomain.com/new-page

Standardize www:

# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

Redirect HTTP to HTTPS:

# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Warning: Incorrect .htaccess syntax can break your entire website. Always back up your original .htaccess file before editing. Read more about what is .htaccess.


Method 4: Redirect via Cloudflare

Cloudflare is an excellent choice if you're already using their CDN, thanks to its intuitive interface and no server-side changes needed.

Using Page Rules (Free/Pro plans):

  1. Log into Cloudflare, select the domain to manage.
  2. Go to Rules > Page Rules.
  3. Click Create Page Rule.
  4. Enter the URL pattern (e.g., *olddomain.com/*).
  5. Select Forwarding URL and click Add.
  6. Choose the redirect type: 301 - Permanent Redirect.
  7. Enter the destination URL (e.g., https://newdomain.com/$1).
  8. Click Save and Deploy.

Using Bulk Redirects (Business/Enterprise plans):

Cloudflare Bulk Redirects supports importing redirect lists from CSV files — very useful when you have hundreds of URLs to redirect.

See also: What is Cloudflare for a full overview of Cloudflare's features.


Method 5: Redirect via Nginx

If you run an Nginx server, redirect configuration goes in the Nginx config file (typically at /etc/nginx/sites-available/):

server {
    listen 80;
    server_name olddomain.com www.olddomain.com;
    return 301 https://newdomain.com$request_uri;
}

Explanation:

  • listen 80: Listen on HTTP port.
  • server_name: The domain to redirect.
  • return 301: Return a 301 redirect with the target URL.
  • $request_uri: Preserve the original path (maintains URL structure).

After adding, test the configuration and reload Nginx:

sudo nginx -t
sudo systemctl reload nginx

Method 6: Redirect via WordPress

WordPress users have several plugin options for easy redirect management without touching code:

Using Rank Math SEO (free):

  1. Go to Rank Math > Redirections.
  2. Click Add New.
  3. Enter the source URL and destination URL.
  4. Choose the redirect type (301, 302, 410, 451).
  5. Click Add Redirection.

Using Yoast SEO Premium:

This plugin includes a Redirects Manager that automatically suggests redirects when you change post URLs.

Using the Redirection Plugin (free):

A dedicated redirect plugin featuring 404 monitoring, import/export, and redirect hit statistics.

Compare SEO plugins in detail: Rank Math vs Yoast SEO and what is Rank Math.


Domain Redirection Method Comparison

MethodDifficultyFlexibilityIndividual URLBest For
Registrar (Namecheap, GoDaddy)LowLowNoWhole domain redirect
cPanelLowMediumYesShared hosting users
.htaccessHighHighYesDevelopers, Apache
CloudflareLowHighYesAll sizes, no server
NginxHighHighYesDevelopers, Nginx
WordPress PluginLowMediumYesWordPress users

How to Verify Your Redirect is Working

After setting up a redirect, always verify it's working correctly. Here are several methods:

  1. Web browser: Type the old URL and check if it automatically forwards to the new URL. Inspect in DevTools > Network to see the HTTP status code (301, 302).
  2. Online tools:
  3. cURL (command line):
    curl -I https://olddomain.com
    
    The output shows the HTTP status code and the destination URL in the Location header.

Tip: Always check for redirect chains — avoid A → B → C when you need A → C. Redirect chains slow down page load speed and dilute SEO value. See optimize website speed for more insights.


Common Domain Redirection Mistakes

Redirect loop

Occurs when URL A redirects to B, and B redirects back to A. The browser shows "ERR_TOO_MANY_REDIRECTS".

Cause: Conflicting redirect configurations — e.g., Cloudflare Page Rules redirecting HTTP→HTTPS while .htaccess does the same.

Fix: Check all redirect sources (registrar, .htaccess, Cloudflare, CMS) and keep only one active.

Wrong redirect type (using 302 instead of 301)

A common mistake during permanent domain changes. 302 redirects do not transfer SEO value to the new domain.

Fix: Always use 301 for permanent changes. Read more in 301 vs 302 Redirect.

Long redirect chains

Each redirect hop consumes page load time and reduces link equity. Google recommends a maximum of 3 redirect steps, but ideally just 1.

Fix: Collapse redirect chains. If A needs to go to C, redirect A→C directly instead of A→B→C. Detect chains with Screaming Frog or Google Search Console.

Inconsistent redirects across platforms

You redirect at the registrar level but forget to update other platforms (Google My Business, Facebook, partner backlinks).

Fix: Create a complete list of all platforms and update them consistently. See what is Google My Business for GMB domain updates.

Letting the old domain expire

After setting up a redirect, many people forget to renew the old domain. When it expires, the redirect stops working.

Fix: Keep the old domain active for at least 1 year after redirecting, or longer if the domain still has valuable backlinks.


Critical SEO Considerations for Domain Redirection

  • Use 301 Redirect for all permanent changes: This is essential for preserving SEO rankings. 301 redirect transfers approximately 90-99% of PageRank value from the old URL to the new one.
  • Update Google Search Console: Add your new domain to GSC and submit a new sitemap. Don't remove the old domain immediately. See Google Search Console guide.
  • Update internal links: Review all internal links on your website and update them to the new URLs. This reduces dependency on redirects.
  • Update backlinks: Contact websites linking to your old domain and ask them to update to the new one.
  • Monitor traffic regularly: Use Google Analytics and Google Search Console to track traffic dips and recovery after the migration.
  • Check for 404 errors post-migration: Some old URLs may not be properly redirected, resulting in 404 errors. Use crawl tools to detect them. Read what is 404 Not Found.
  • Back up everything: Before making any major changes, ensure you have a complete backup. See WordPress data backup.

Frequently Asked Questions

How long does domain redirection take to work?

It depends on the method:

  • Registrar/Cloudflare: Typically 5-30 minutes due to DNS TTL.
  • .htaccess/cPanel/Nginx: Nearly instant.
  • Full global DNS propagation: Can take 24-48 hours worldwide.

Does 301 redirect lose SEO rankings?

No — if done correctly. A 301 redirect transfers most SEO value to the new URL. However, it may take 1-2 weeks for Google to update its index and rankings to stabilize. Read what is SEO to understand how Google processes redirects.

Can I redirect individual pages?

Yes. Using .htaccess, cPanel, Cloudflare Page Rules, or WordPress plugins, you can redirect specific individual URLs rather than the entire domain.

What's the difference between URL Forwarding and DNS Redirect?

URL Forwarding (registrar-level redirect) returns an HTML frame or HTTP redirect to the destination URL. DNS Redirect (CNAME or ALIAS records) works at the DNS level only — it redirects the entire domain but cannot redirect individual URL paths.


Conclusion

Domain redirection is a critical technique every website owner should master, especially when rebranding, upgrading to HTTPS, or restructuring your website. Depending on your technical expertise and infrastructure, you can choose from six methods detailed in this guide.

The golden rule: Always use 301 for permanent changes, thoroughly test after setup, and maintain your old domain for at least one year.

Need help with domain redirection or other technical SEO issues? Contact our team for expert guidance and support.

Comments

0 Comment(s)

Loading...

Latest Posts

Related Posts

Newsletter border

Subscribe to Receive Updates from RiverLee