Redirecting one domain to another is a common website management task. You may need to do it after a rebrand, domain migration, business name change, website consolidation, or when moving from an old domain to a new one.
If you are wondering how to redirect a domain to another domain, the basic process involves configuring your server, hosting control panel, DNS provider, CDN, or website platform so that visitors and search engines are automatically sent from the old domain to the new destination.
For example:
olddomain.com
can redirect to:
newdomain.com
A properly configured domain redirect helps maintain traffic, preserve user experience, reduce broken links, and communicate the website move to search engines.
In most permanent domain migrations, a 301 redirect is typically the correct choice because it tells search engines that the old domain has permanently moved.
In this guide, you will learn how domain redirects work, how to redirect a domain using different methods, how to redirect individual pages correctly, what mistakes to avoid, and how to test your redirects after setup.
What Is a Domain Redirect?
A domain redirect automatically sends visitors from one domain name to another.
For example, suppose your old website is:
and your new website is:
When a user visits the old domain, the server can automatically redirect them to the new domain.
The process looks like this:
Old Domain → Redirect → New Domain
Domain redirects can also preserve paths.
For example:
can redirect to:
and:
can redirect to:
This page-to-page redirect structure is usually better for SEO and user experience than sending every old URL to the new homepage.
Why Redirect a Domain to Another Domain?
There are many reasons you might need to redirect an entire domain.
Rebranding
Your company may change its name and move to a new domain.
Example:
oldcompany.com
becomes:
newcompany.com
Redirecting the old domain ensures existing customers, backlinks, bookmarks, and search engine users still reach the new website.
Changing to a Better Domain
You may purchase a shorter, more memorable, or more relevant domain.
Instead of abandoning the old one, you can redirect it to the new address.
Merging Two Websites
If two websites are combined, one domain may become the primary site.
The secondary domain can then redirect relevant URLs to equivalent pages on the main domain.
Moving From an Old Brand
If your old domain is still receiving direct traffic or backlinks, a redirect helps preserve that value instead of letting the old URLs become dead ends.
Correcting Domain Variations
You may also redirect domain variations such as:
example.net
to:
example.com
or:
example.org
to:
example.com
This can help consolidate traffic under one primary domain.
Should You Use a 301 or 302 Redirect for a Domain?
For a permanent domain move, you should generally use a 301 redirect.
A 301 redirect means:
Moved Permanently
It tells browsers and search engines that the old domain has permanently moved to a new location.
A 302 redirect means the move is temporary.
Use a 301 Redirect When:
- The domain has permanently changed
- You are rebranding
- You are merging websites
- You are permanently switching to a new domain
- The old domain will no longer be used as the primary site
Use a 302 Redirect When:
- The domain change is temporary
- You are testing another website
- The original domain will be restored soon
- You are temporarily routing users elsewhere
For most domain migrations, a 301 redirect is the more appropriate option.
How to Redirect a Domain to Another Domain
There are several ways to redirect a domain depending on your hosting environment.
Common methods include:
- cPanel
- Apache
.htaccess - Nginx
- Cloudflare
- Domain registrar forwarding
- WordPress
- Hosting dashboards
The exact method depends on where your website is hosted and how your server is configured.
Method 1: Redirect a Domain Using cPanel
Many shared hosting providers use cPanel.
If your hosting account includes cPanel, you may be able to create the redirect without manually editing server configuration files.
Step 1: Log In to cPanel
Open your hosting dashboard and access cPanel.
Step 2: Find Redirects
Look for the Redirects tool under the Domains section.
Step 3: Choose the Redirect Type
Select:
Permanent (301)
if you are permanently moving the domain.
Step 4: Select the Old Domain
Choose the domain you want to redirect.
For example:
olddomain.com
Step 5: Enter the New Domain
Enter your destination URL:
Step 6: Configure WWW Options
Depending on your cPanel setup, you may be able to specify whether the redirect should apply to:
- Only the www version
- Only the non-www version
- Both versions
For most migrations, you should make sure both versions redirect correctly.
Step 7: Save the Redirect
Click the appropriate button to create the redirect.
After setup, test the old domain in your browser and with a redirect checker.
Method 2: Redirect a Domain Using .htaccess
If your site runs on an Apache server, you can often configure redirects using the .htaccess file.
Before editing this file, create a backup.
A small configuration error in .htaccess can make your website inaccessible.
Redirect an Entire Domain
A common configuration looks like:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
This configuration preserves the URL path.
For example:
olddomain.com/about
redirects to:
newdomain.com/about
and:
olddomain.com/blog/post
redirects to:
newdomain.com/blog/post
This is often preferable to redirecting all URLs to the homepage.
Method 3: Redirect a Domain Using Nginx
If your server uses Nginx, you can configure a domain redirect in the server configuration.
A simple example is:
server {
listen 80;
server_name olddomain.com www.olddomain.com;
return 301 https://newdomain.com$request_uri;
}
The $request_uri component preserves the page path.
For example:
olddomain.com/services
becomes:
newdomain.com/services
You may also need HTTPS-specific configuration depending on your server and SSL setup.
After changing Nginx configuration, always test the configuration before reloading or restarting the service.
Method 4: Redirect a Domain Using Cloudflare
If your domain uses Cloudflare, you can configure redirects at the CDN level.
Cloudflare can redirect traffic before it reaches your origin server.
Depending on your account and current Cloudflare interface, redirect functionality may be available through redirect rules.
The general process is:
- Log in to Cloudflare
- Select the old domain
- Open the rules or redirect section
- Create a redirect rule
- Match traffic from the old domain
- Set the destination to the new domain
- Choose a permanent redirect status such as 301
- Preserve the path if necessary
- Save and deploy the rule
Be careful with wildcard rules because incorrect patterns may send users to the wrong destination.
Method 5: Redirect Through Your Domain Registrar
Some domain registrars offer a feature called:
- URL forwarding
- Web forwarding
- Domain forwarding
- Redirect domain
You can often find this feature in your domain management dashboard.
The setup usually involves selecting the old domain and entering the new destination URL.
For example:
Destination:
Then choose a permanent redirect if the option is available.
Domain forwarding is convenient when you do not have hosting for the old domain.
However, make sure the service supports proper HTTP redirects and path forwarding if SEO is important.
Method 6: Redirect a WordPress Domain
If you are moving a WordPress website to another domain, the best approach is usually to configure the redirect at the server or hosting level.
However, WordPress plugins can sometimes assist with page-level redirects.
For an entire domain migration, server-level redirection is often more efficient because it works before WordPress fully loads.
Typical migration steps include:
- Move the website to the new domain
- Update the WordPress Address
- Update the Site Address
- Update database URLs if needed
- Configure 301 redirects from the old domain
- Test important pages
- Update internal links
- Update your sitemap
- Update analytics and webmaster tools
Do not rely only on manually redirecting the homepage.
You should also make sure individual old URLs reach the appropriate new pages.
How to Redirect All Pages to the Same Path on a New Domain
This is often the best approach when the website structure remains the same.
Suppose you have:
oldsite.com/about
oldsite.com/pricing
oldsite.com/blog
and the new site uses:
newsite.com/about
newsite.com/pricing
newsite.com/blog
You should preserve each path.
The ideal redirect structure is:
oldsite.com/about → newsite.com/about
oldsite.com/pricing → newsite.com/pricing
oldsite.com/blog → newsite.com/blog
This helps users reach the content they expected.
It also helps search engines understand that each old page has a direct replacement.
Why You Should Not Redirect Every Old URL to the Homepage
One of the most common migration mistakes is redirecting every old page to the new homepage.
For example:
oldsite.com/blog/seo-guide
→
newsite.com
and:
oldsite.com/services/web-design
→
newsite.com
This is usually a poor approach because the homepage may not match the user’s intent.
A visitor who clicks a link to an SEO guide probably expects to reach an SEO-related page, not a generic homepage.
Instead, redirect the old page to the closest relevant replacement.
What If the URL Structure Changes?
Sometimes the new domain has a completely different site structure.
For example:
Old URL:
oldsite.com/blog/how-to-do-seo
New URL:
newsite.com/resources/seo-guide
In this case, simple path preservation is not enough.
You will need custom redirect mappings.
A redirect map can look like:
| Old URL | New URL |
|---|---|
/blog/how-to-do-seo | /resources/seo-guide |
/services/seo | /solutions/search-marketing |
/contact-us | /contact |
For large websites, creating a full redirect map before migration is extremely important.
How Domain Redirects Affect SEO
A domain migration can affect organic search performance if it is not handled carefully.
Proper redirects help search engines understand the move and discover the new URLs.
Preserve Backlink Value
Suppose hundreds of websites link to:
oldsite.com/guide
If that page redirects to:
newsite.com/guide
search engines can associate the old URL with the new destination.
Without a redirect, those backlinks would point to a broken page.
Preserve User Traffic
People may still have old pages:
- Bookmarked
- Shared in emails
- Saved in documents
- Linked from social media
- Linked from other websites
Redirects ensure they still reach your content.
Help Search Engines Discover the New Domain
When search engines crawl old URLs and encounter permanent redirects, they can begin replacing those URLs with the new domain.
This process can take time, especially for large sites.
Important Steps Before Redirecting a Domain
Before activating your domain redirect, prepare carefully.
Crawl the Old Website
Create a list of important URLs.
This can include:
- Homepage
- Service pages
- Product pages
- Blog posts
- Category pages
- Landing pages
- High-traffic pages
- Pages with backlinks
Map Old URLs to New URLs
Every valuable old page should have the closest possible destination.
Backup the Website
Keep backups of the website and server configuration.
Verify the New Website
Make sure the new domain is fully functional before redirecting traffic.
Check SSL
Both old and new domains should handle HTTPS correctly.
If the old domain has HTTPS but its certificate has expired, users may see a security warning before the redirect occurs.
Redirect HTTP to HTTPS During a Domain Move
You may have multiple versions of the old domain:
http://olddomain.com
http://www.olddomain.com
Ideally, all relevant variants should ultimately reach the canonical version of the new domain.
For example:
http://olddomain.com/page
→
Keeping the path and sending users to the final preferred HTTPS destination can reduce unnecessary redirect hops.
Avoid Redirect Chains
A redirect chain happens when one URL redirects multiple times.
For example:
oldsite.com
→
www.oldsite.com
→
http://newsite.com
→
This contains several unnecessary hops.
A cleaner solution would be:
oldsite.com
→
where possible.
Long redirect chains may:
- Slow page loading
- Complicate crawling
- Create migration errors
- Make debugging harder
Avoid Redirect Loops
A redirect loop happens when URLs keep sending users back and forth.
For example:
olddomain.com
→
newdomain.com
and:
newdomain.com
→
olddomain.com
The browser can never reach a final destination.
Users may see a message such as:
Too many redirects
Always test your rules after implementation.
How to Check a Domain Redirect
After setting up a redirect, you should verify it.
You can use RedirectCheckr.com to inspect the redirect path and HTTP status response.
A redirect checker can help you see:
- Initial URL
- HTTP status code
- Redirect type
- Intermediate redirects
- Final destination
- Redirect chain
- Redirect loop issues
For example, you might expect:
olddomain.com/page
→ 301 →
newdomain.com/page
But the actual result could be:
olddomain.com/page
→ 301 →
www.olddomain.com/page
→ 302 →
newdomain.com/page
This reveals an unnecessary redirect chain.
How to Test a Full Domain Migration
Do not only test the homepage.
Check several types of URLs.
Test:
- Homepage
- Old blog posts
- Product pages
- Service pages
- Category pages
- HTTP URLs
- HTTPS URLs
- WWW version
- Non-WWW version
- URLs with parameters
- Popular backlink destinations
A successful migration should send each important old URL to the correct new destination.
Common Domain Redirect Mistakes
Redirecting Only the Homepage
Users visiting deeper old URLs may still receive 404 errors.
Using 302 for a Permanent Move
A temporary redirect may not accurately communicate a permanent domain migration.
Redirecting Everything to the Homepage
This creates poor relevance for old URLs.
Forgetting HTTPS
Old HTTPS URLs may fail if SSL is not configured correctly.
Leaving Redirect Chains
Old rules may create several hops before the final destination.
Redirecting to Broken URLs
Always verify that the new destination returns a valid response.
Changing Too Many Things at Once
Changing the domain, content, site structure, URLs, navigation, and design simultaneously can make migration issues harder to diagnose.
How Long Should You Keep Domain Redirects?
For important permanent domain migrations, redirects should generally remain active for a long time.
Old URLs may continue receiving traffic from:
- Backlinks
- Browser bookmarks
- Old emails
- Search engine records
- Social posts
- Documents
Removing redirects too soon can cause those users to encounter broken pages.
If you continue owning the old domain, keeping the redirects active is often useful.
Should You Keep the Old Domain?
In many cases, yes.
If you allow the old domain to expire, someone else may register it.
You can also lose control of old backlinks and direct traffic.
Maintaining ownership of the old domain allows you to keep redirects active and protect the previous brand name.
Update Internal Links After a Domain Move
Your new website should link directly to new URLs.
Avoid internal links that still point to the old domain and rely on redirects.
Instead of:
New page → Old URL → 301 → New URL
use:
New page → New URL
This keeps your internal linking structure cleaner.
Update Your XML Sitemap
After moving domains, your XML sitemap should list URLs on the new domain.
Do not continue submitting old redirected URLs as your primary sitemap.
For example:
Old sitemap URL:
New sitemap URL:
The new sitemap helps search engines discover the updated website structure.
Update Canonical Tags
Check that canonical tags reference the new domain.
A new page should not accidentally contain:
rel="canonical" pointing to the old domain.
This could send conflicting signals.
Update Analytics and Search Tools
After the migration, update relevant services such as:
- Analytics platforms
- Search engine webmaster tools
- Advertising accounts
- Conversion tracking
- Tag managers
- Third-party integrations
Make sure the new domain is being tracked correctly.
Frequently Asked Questions
How do I redirect one domain to another?
Configure a redirect through your web server, hosting control panel, CDN, or domain forwarding service. For permanent migrations, use an appropriate permanent redirect such as 301.
Can I redirect an entire domain?
Yes. You can redirect all traffic from one domain to another while preserving page paths when appropriate.
Should I use 301 when moving to a new domain?
If the move is permanent, a 301 redirect is typically the correct choice.
Can I redirect a domain without hosting?
Some domain registrars provide URL forwarding that allows you to redirect a domain without traditional web hosting.
Does domain forwarding affect SEO?
It depends on how it is implemented. Proper permanent HTTP redirects with relevant page-to-page destinations are generally the preferred approach for SEO-focused migrations.
Should all old pages redirect to the new homepage?
No. Whenever possible, redirect each old URL to the closest relevant new page.
How do I check whether my domain redirect works?
Use a redirect checker such as RedirectCheckr.com to inspect the HTTP response, redirect path, and final destination.
Can a domain redirect create a loop?
Yes. Conflicting server, hosting, CDN, or CMS rules can create redirect loops. Test all redirect configurations after setup.
Final Thoughts
Learning how to redirect a domain to another domain is essential when migrating, rebranding, consolidating websites, or changing your online identity.
For a permanent move, the typical process is:
- Prepare the new domain
- Map old URLs to new URLs
- Configure permanent redirects
- Preserve paths where possible
- Update internal links
- Update canonical tags and sitemaps
- Check HTTPS and domain variants
- Test the redirects
- Monitor the migration
The most important principle is to send visitors to the most relevant destination.
Do not simply redirect every old URL to the homepage.
Instead:
oldsite.com/page-a
should ideally redirect to:
newsite.com/page-a
or the closest equivalent page.
Proper domain redirects help users continue accessing your content while helping search engines understand that your website has moved.
After configuring your redirect, use RedirectCheckr.com to check status codes, verify destinations, identify redirect chains, and confirm that your old domain correctly points to your new website.