Redirect One Domain to Another: Step-by-Step
Redirecting one domain to another sends all visitors from the old web address (for example, oldsite.com) to a new one (newsite.com) automatically. This is essential when you rebrand, move to a new domain, or consolidate multiple sites. The redirect preserves your traffic, bookmarks, and search engine rankings. Before you start, you need access to your domain registrar (where you bought the domain) and your web hosting control panel (like cPanel, Plesk, or a custom dashboard).
What You’ll Need
- Access to your domain registrar account (e.g., Namecheap, GoDaddy, Google Domains).
- Access to your web hosting control panel (cPanel, Plesk, or your host’s custom panel).
- If you use a CMS like WordPress, admin access to the site.
- For advanced redirects, ability to edit files on the server via FTP or file manager.
Step-by-Step
- Decide the type of redirect you need. For most cases, a 301 (permanent) redirect is correct. It tells search engines and browsers that the old page has moved permanently. Use a 302 (temporary) only if you plan to move back later.
- Choose your redirect method. The best method depends on your setup:
- If you have access to the server’s Apache or Nginx config, use .htaccess (Apache) or server block config (Nginx).
- If you use cPanel, use the “Redirects” tool.
- If you use WordPress, use a plugin or add code to your theme’s functions.php.
- If you only have domain-level access (no hosting), use the registrar’s domain forwarding feature.
- Redirect via cPanel (most shared hosts).
- Log into cPanel.
- Find the “Domains” section and click “Redirects”.
- Choose the type: Permanent (301) or Temporary (302).
- In “Domain”, select the old domain (e.g., oldsite.com).
- Leave the path empty to redirect all pages, or enter a specific path (e.g., /old-page).
- In “Redirects to”, enter the full new URL (e.g., https://newsite.com).
- Check “Wild Card Redirect” if you want all subpages to redirect to the corresponding path on the new domain (e.g., oldsite.com/page → newsite.com/page).
- Click “Add” or “Save”.
- Redirect via .htaccess (Apache servers).
- Open the root directory of your old site (where index.php or index.html lives).
- If a file named .htaccess exists, download it and edit it. If not, create a new file named .htaccess.
- Add the following code at the top (replace oldsite.com and newsite.com with your actual domains):
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.com$ [NC] RewriteRule ^(.*)$ https://newsite.com/$1 [R=301,L] - Save the file and upload it back to the server.
- Redirect via Nginx.
- Access your Nginx configuration file (usually in /etc/nginx/sites-available/).
- Add a server block for the old domain:
server { listen 80; server_name oldsite.com www.oldsite.com; return 301 https://newsite.com$request_uri; } - If you have SSL, add port 443 with the same return line.
- Test the config with
nginx -tand reload Nginx.
- Redirect via domain registrar (if you don’t have hosting).
- Log into your domain registrar account.
- Go to “Domain Management” or “My Domains”.
- Find the old domain and look for “Forwarding” or “Redirect”.
- Enter the new URL (e.g., https://newsite.com).
- Choose 301 Permanent.
- Save and wait for DNS propagation (can take up to 48 hours).
- Redirect in WordPress.
- Install a plugin like “Redirection” or “Simple 301 Redirects”.
- Activate the plugin.
- Go to the plugin settings and add a new redirect: old URL (e.g., /old-page) → new URL (e.g., https://newsite.com/new-page).
- Set the type to 301.
- Save. The plugin will handle the rest.
- Test the redirect.
- Open a browser in incognito/private mode.
- Type the old domain (e.g., http://oldsite.com) and press Enter.
- You should be taken to the new domain automatically.
- Also test a subpage (e.g., oldsite.com/contact) to ensure it redirects correctly.
- Update DNS (if needed). If you are not using the registrar’s forwarding, ensure the old domain’s DNS points to the server where the redirect is set up. Usually, this is already the case if the old site was hosted on that server.
Common Mistakes
- Using a 302 instead of 301 – If you intend the move to be permanent, a 302 tells search engines to keep the old URL indexed, which can split ranking signals.
- Forgetting the www vs non-www – Redirect both www.oldsite.com and oldsite.com to the new domain, otherwise one version may not redirect.
- Redirecting only the homepage – If you don’t use wildcard or path-based redirects, subpages may return 404 errors.
- Creating a redirect loop – If the new domain also redirects back to the old one, visitors get stuck in an endless loop. Always test.
- Not updating internal links – After redirecting, update links within your new site to point directly to the new URLs, avoiding unnecessary redirect chains.
- Ignoring HTTPS – If your new site uses HTTPS, make sure the redirect goes to the https:// version, not http://.
Tips
- Use a 301 redirect for SEO: it transfers most of the link equity from the old domain to the new one.
- Set up redirects for every old URL that has traffic or backlinks, not just the homepage.
- Use a redirect map for large sites: create a CSV or array mapping old URLs to new URLs, then implement it with a script or plugin.
- Monitor your search console (Google Search Console) to see if the old domain’s pages are being indexed correctly after the move.
- Keep the old domain active for at least a year after the move, because some visitors may still use old bookmarks.
- If you are redirecting to a different domain entirely, update your email addresses and any third-party services that use the old domain.
Troubleshooting
- Redirect not working? First, check if the old domain’s DNS points to the server where the redirect is configured. Use a tool like
nslookupor an online DNS checker. If the DNS is wrong, update it at the registrar. - Getting a 404 error? This often means the redirect rule is not matching the URL. Check if the path is correct in your .htaccess or redirect rule. For cPanel, ensure you didn’t leave the path empty when you wanted to redirect all.
- Redirect loop (too many redirects)? This happens when the new domain redirects back to the old. Check the new site’s .htaccess or server config for any redirect rules that point back. Also check if your CMS has a site URL setting that is causing a redirect.
- Only the homepage redirects, not subpages? In cPanel, check the “Wild Card Redirect” option. In .htaccess, ensure your rule uses
^(.*)$to capture the full path. - SSL certificate error? If you see a security warning, your old domain may not have an SSL certificate. Consider installing a free SSL (Let’s Encrypt) on the old domain before redirecting, or use a redirect at the DNS level that doesn’t require SSL.
- Changes not taking effect? DNS and browser caches can delay the redirect. Clear your browser cache, try a different browser, or wait 24-48 hours.
Frequently Asked Questions
What is the difference between 301 and 302 redirects?
A 301 is permanent and tells search engines to replace the old URL with the new one. A 302 is temporary and keeps the old URL indexed. For permanent moves, always use 301.
Will a redirect affect my SEO rankings?
Yes, a 301 redirect passes most of the ranking power (link equity) to the new URL. If done correctly, your rankings should transfer, though there may be a temporary dip during the transition.
Can I redirect a domain without hosting?
Yes, most domain registrars offer free domain forwarding. You log in, enter the destination URL, and choose a 301 redirect. This works even if you don’t have a website on the old domain.
How long does a redirect take to work?
Server-side redirects (like .htaccess) work immediately after saving. DNS-based forwarding can take up to 48 hours to propagate worldwide, but usually works within a few hours.
Do I need to redirect every single page?
Ideally, yes. If you only redirect the homepage, visitors to old subpages will get 404 errors. Use wildcard redirects or individual rules for each important page.
Can I redirect a subdomain like blog.oldsite.com?
Yes. You can create a separate redirect rule for the subdomain. In cPanel, you can add a redirect for the subdomain. In .htaccess, add a condition for the specific host.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.