How To 301 Redirect A Domain Old Domain To A New Domain

Apr 16, 2023 Domain Name

How to 301 Redirect a Domain: Old Domain to a New Domain – A Step-by-Step Guide

Reading Time: 4 minutes

If you’re planning to change your website’s domain name, you’ll want to redirect your old domain to the new one. Redirecting your old domain to a new domain ensures that your visitors can find your website even after you’ve changed your domain name. Redirecting your old domain to a new domain can also help you preserve your website’s search engine rankings and backlinks. In this guide, we’ll cover the step-by-step process for redirecting an old domain to a new domain.

Step 1: Choose the Type of Redirect

Before you can start redirecting your old domain to your new domain, you’ll need to decide which type of redirect to use. There are two types of redirects: a 301 redirect and a 302 redirect. A 301 redirect is a permanent redirect that signals to search engines that the old domain has moved to a new domain. A 302 redirect is a temporary redirect that tells search engines that the old domain has temporarily moved to a new domain.

In most cases, you’ll want to use a 301 redirect. A 301 redirect tells search engines that your website has permanently moved to a new domain, which can help preserve your website’s search engine rankings and backlinks.

Step 2: Update the DNS Settings

If you’re only redirecting the root domain (e.g., example.com) to your new domain, you can create a DNS record that points the old domain to the IP address of the new domain. This method is simple and quick to set up, but it only works for redirecting the root domain, not for specific pages or subdomains.

To create a DNS record, log in to your domain registrar’s website or DNS provider’s website, find the DNS management section, and create an “A” record that points to the IP address of the new domain.

Step 3: Set Up the Redirect on the Server

If you want to redirect specific pages or subdomains, you’ll need to set up the redirect on the server using a .htaccess file. A .htaccess file is a configuration file that controls the behavior of the Apache web server.

To set up a redirect using a .htaccess file, follow these steps:

  1. Connect to the old domain’s server via FTP or SSH.
  2. Find the .htaccess file in the root directory of the old domain.
  3. If the file does not exist, create a new file and name it “.htaccess”.
  4. Add the following lines of code to the file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^old-domain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.com [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [L,R=301,NC]

Replace “old-domain.com” with your old domain name and “new-domain.com” with your new domain name.

Step 4: Test the Redirect

After setting up the redirect, it’s important to test it thoroughly to ensure that it works as expected. Try accessing different pages and subdomains on the old domain and see if they redirect to the corresponding pages and subdomains on the new domain. Check for any broken links, error messages, or unexpected behavior.

Use a tool like Redirect Checker to verify that the redirect is a 301 redirect and not a 302 redirect.

Step 5: Update Internal and External Links

After setting up the redirect, you’ll need to update any internal links on your website that point to the old domain to point to the new domain. This includes links in your website’s navigation menu, footer, sidebar, and content. You should also update any external links that point to the old domain, such as links from social media profiles, online directories, and other websites.

To update internal links, you can use a search and replace tool like the Better Search Replace plugin for WordPress. This tool allows you to search for instances of your old domain in your website’s database and replace them with the new domain. Make sure to double-check all of the updated links to ensure that they are working correctly.

To update external links, you’ll need to manually update each link to point to the new domain. This can be a time-consuming process, but it’s important to ensure that your visitors can still access your website from external sources.

Updating your internal and external links may take some time, but it’s a crucial step in ensuring that your visitors can find your website after the domain change.

Step 6: Notify Users and Search Engines

Once you’ve completed the redirect and updated your internal links, you should notify your users and search engines about the change. This helps to ensure that your visitors are aware of the new domain name and that search engines can update their index accordingly.

To notify your users, consider sending out an email newsletter or posting an announcement on your website or social media accounts. Make sure to include the new domain name and any relevant information about the change.

To notify search engines, submit a sitemap of your new domain to Google Search Console and Bing Webmaster Tools. This helps search engines to discover your new domain and update their index accordingly.

It’s also a good idea to monitor your website’s traffic and search engine rankings after the redirect to ensure that everything is working as expected. You may need to make further adjustments or corrections if you notice any issues.


Redirecting an old domain to a new domain is a crucial step when changing your website’s domain name. By following the step-by-step process outlined in this guide, you can ensure that your visitors can find your website even after the domain change and that your website’s search engine rankings and backlinks are preserved. Remember to test the redirect thoroughly and update your internal and external links, as well as notify your users and search engines about the change.

SHARE NOW

Leave a Reply

Your email address will not be published. Required fields are marked *