How to 301 to a new domain

How to 301 redirect to a new domain name without comprimising your SEO

Moving your website to a new domain can be a daunting but necessary process. Whether you’re moving your site for a rebrand, consolidation or you’ve simply got your hands on a better domain, you should be thinking about your SEO.

I’ve moved websites to new domains countless times and the great news is that if done correctly, you can easily preserve your rankings and domain authority by correctly using 301 redirects and Google Webmaster Tools. In this tutorial, I’m going to walk you through the exact process that I use to change domains whilst having no negative impact on SEO.

A few things first.

My colleague Nick and I are currently working on a video blog that walks through the different circumstances as to why you might be changing domains. I’ll link that up once it’s live, but in the meantime I’m going to assume that you’re simply changing domains, and your website architecture (sitemap, URLs etc) are not going to change.

Same site, new domain.

As Google themselves recommend, if you’re changing domains AND launching a new website, you should do it in two separate phases. Change the domain first, then update the website once the domain change has settled.

Step 1 – Preparation

In all, the process of changing domain names can take less than an hour if you’re prepared. Before you begin, you should have the following things ready and in place:

  • Either a full working version of the same website, located on the NEW domain name, on it’s own hosting environment (with either robots.txt and/or Meta Tags temporarily in place to block search engines until you’ve 301’d).
  • Or, the ability to quickly change your hosted site’s domain via your hosting panel and (if necessary) Database references to the domain.

Either of the above options are fine, but you need to make sure that you can still host both domains after you launch the site on the new domain. Your old domain will need to host a small ‘.htaccess file’ in order to ensure redirects are passed onto the new domain.

  • Both domains should be verified and accessible in your Google Webmaster Tools account.
  • If you use Google Analytics, ensure you have sufficient permissions to change the domain settings for your site’s profile.
  • Back-up your website and database(s).

Step 2 – 301 redirect(s)

In order to preserve both your traffic and back-link equity from the old domain, it’s important to 301 redirect all of your individual URLs to the new domain. The simplest and most efficient way to do this, is via your site’s .htaccess file. If you look at the diagram below, this illustrates how you can host a lone .htaccess file on your old domain that redirects all requests onto their counterpart at the new domain:

How the .htaccess file 301 redirects users that request the old URL

I should again stress that I’m assuming that your only changing domain and therefore your sitemap and individual URLs are not going to change. In my diagram above, you can see how individual spec-specific requests can be directly matched and redirected onto the same page at the new domain. Using the .htaccess template below, you can do this dynamically without having to write a 301 redirect line of code for each individual page:

By adding this code to your old domain’s hosted .htaccess file, you’re essentially saying if someone accesses any URL that isn’t the using the new URL (, then redirect to the same URL but under the new domain. Therefore no matter how many pages your site has, the above 2 lines of .htaccess will work for all of your pages. If however your URLs have changed too, you’ll need to individually redirect each page on the .htaccess file like this:

redirect 301 /old-contact-url.html
redirect 301 /old-about-url.html

It’s important to have your .htaccess file and/or 301 commands ready before you switch the domain over. Once you’ve successfully migrated your site, this .htaccess file is all you’ll need to host on the old domain in order to successfully redirect.

Step 3 – Change the domain

You should now be in a position to change domains. If you have a separate copy of the same site live on the new domain already, all that remains is to deploy your .htaccess file to the OLD domain hosting. Even if you leave all of your files on the old server as a back-up, the .htaccess file should redirect any and all traffic/requests onto your new domain whether they’re accessing the homepage or an individual landing page. Make sure you remove any robots.txt commands or Meta Tags on the new domain that will prevent it from being crawled and cached.

If, rather than running the two domains alongside each other, you’re changing the one hosted site to the new domain then you’re now ready to do this. Once changed, you now need to set-up hosting for the OLD domain so that you can upload the .htaccess file.

Hopefully step 3 makes sense, if it doesn’t please write a message in the comments below before you proceed.

Step 4 – Tell Google

So by this stage, you should have your website live on the new domain, with any old domain URL requests being 301 redirected to their counterparts on the new domain. Correct implementation of the 301 redirects is good enough alone, but Google offer several features within Webmaster Tools to make sure the process is as smooth as possible.

Webmaster Tools: ‘Change of Address’

Start by performing  a ‘Change of Address‘ within Webmaster Tools for your old domain. Simply navigate to your old domain, and click on the cog in the top right corner:

Change of Address in WMT

As you should already have your new domain verified too, select this in the drop down below, and press submit. If you’d like to learn more about ‘Change of Address’ and why it’s worth using, Google’s Matt Cutts explains it in a video here.

Webmaster Tools: Submit your new domain’s sitemap(s)

To further assist the process, i’d recommend submitting your new XML sitemaps to Google. Simply navigate to Crawl > Sitemaps:

Submitting your XML sitemap in Webmaster Tools

Start by initially testing your XML sitemaps, then once you’re satisfied they’re 100%, Add them onto the profile for crawling.

Webmaster Tools: Fetch as Google

In order to speed up the caching and switch-over of the new domain, i’d also recommend submitting your key page(s) via ‘Fetch as Google’. Navigate to Crawl > Fetch as Google:

Fetch as Google

Start by fetching your new domain’s homepage and any other key landing pages that you’d like to be promptly crawled by Google. Worth noting that you don’t need to worry about over-using this feature.

Step 5 – Finishing Up

You should now have a fully working site on the new domain, with the old domain redirecting requests and traffic perfectly. Not only that, but Google is in the process of switching your domain over in its’ cache of your site. I’d recommend spending some time next just testing your 301s, a good way of doing this is to search for your old domain using the search query:

This will bring up all of your old domain’s cached pages within the results. Click away at the various listings to double check they all 301 redirect onto their counterpart on the new domain.

Finally, don’t forget to update your Google Analytics profile. Rather than creating a brand new profile (unless you want to that is) you can simply change the domain URL that you’re asking Google to track.

That’s it! If you have any questions or recommendations to improve this process, I’d love to hear your comments below.

  • Tamara


    I tried this and i managed to get the old domain to redierct to the new one. However it’s only working for the home page not any other page, even if I am clicking on links in the new domain site (which is a copy of the old one)

  • Von Grootel

    Hi James,

    Are you able to do this for me? I’m willing to pay you if you can do this correctly for me.

    I’m looking forward to your reply, please email me.

    Best Regards,

    Von Grootel

    • James Bavington

      Hi, no problem, I can’t see your email address though, so if you could email or DM me, I’m james .at.

  • Ali Raza

    Hello James,
    I want to know that I have 10 domains and I redirect them to my main site. But problem is that these 10 domains have many backlinks and mostly are from same sites. So these all backlinks are now pointing to my main site and are visible in google webmaster account on main site. So what about these all backlinks ? will goolge penalize my site due to many links from same websites>

    • James Bavington

      Hi Ali, it all depends on the quality of those links. Backlink equity (whether good or bad) is passed onto your main site when you redirect the domains onto your primary one. If the backlink equity is poor, then this will be passed through to your main site. Have you done a health check on the quality of the 10 domains you’re forwarding to determine whether they’re OK to 301 redirect?

      • Ali Raza

        How can I check health of domain? Via majesticseo and opensiteexplorer? If yes so these domains have good pa and da but these all domains have mostly profile backlinks. Can I share some domains here? so you can check them and will be able to advice me more clearly.

      • Ali Raza

        And one more question which I can not find on internet if you can help me. I have https on my site and now I am unable to use feedburner signup form on my site. Is there any way to exclude feed page from https.

  • Robbyrobs

    Hi. I wanted to redirect my domain to a new domain I recently purchased. Before looking into redirecting, I set up separate webmaster and google analytics tools for this new domain. Then I looked into redirecting. I have set up 301 direct. I then went into the webmaster pages for the old domain and undertook a ‘change of name’. Now it looks like I have two webmaster accounts for the same domain. The new one is registered for the email address of the new domain. Is this a problem. Now that I have done the change of address should I shut down the new webmaster account, and if so how.

  • Matt

    Thanks for the article James. It’s all pretty clear, except one thing: what to do if you move your website to a new domain AND change some URLs as well (but not all)? So most pages on the new domain will match, but some won’t.

    Moving individual pages, you would need to write redirects for each one:
    redirect 301 /old-contact-url.html
    redirect 301 /old-about-url.html

    However, I also want to redirect the whole domain. If I add this line at the top:
    redirect 301 /

    This rule will redirect all other pages (on the old domain) as well. So then I would have to also add redirects on the new website/domain to redirect the moved pages.

    Or is the solution to start with all individual pages and end with the general rule?
    redirect 301 /old-contact-url.html
    redirect 301 /old-about-url.html
    redirect 301 /

    • James Bavington

      So if you’re changing domains, you’ll need to host the .htaccess file in Step 2 on your old domain only. This will basically migrate all the traffic over to your new domain. Then you can redirect the users on further with the new separate .htaccess file on your new domain’s hosting if that makes sense? So technically your migration is definitely possible, you’ll just need to host two separate .htaccess files on both domains.

    • ymbhweorfnes

      Both will work. The 2nd assumes you still have hosting space to be able to store your .htaccess.

  • david brinton

    Your htaccess redirect is different from what I’m using.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^$ [OR]
    RewriteCond %{HTTP_HOST} ^$ [NC]
    RewriteRule ^(.*)$$1 [R=301,L]

    Please tell what’s the difference. Do they work the same, or is mine missing something or doing something it shouldn’t?

    • Freelance Web Designer

      correct me if I’m wrong but I think it additionally redirects non www version to www version

      • James Bavington

        Exactly right

  • AK

    Great article, thanks! I was just wondering if it´s possible to perform “healthy” redirect from htacess at the new domain, when the old domain are already pointing at the new one?

  • ahmad

    So thanks for your helpful article.
    I’m going to get a new domain and redirect it to an old subdomain.

    I want to know is this work will damage my subdomain’s google rank?

    • James Bavington

      If you’re buying a brand new domain, and simply pointing it to an existing, established subdomain, I can’t see how this would negatively impact your subdomain’s authority. Providing the new domain was not previously registered and in use, it should be fine.

  • Brian Stitt

    So if i have a key word aged domain that has an ok link profile and DA/PA – it should pass on the previous backlinks / SEO value? That is if I 301 / forward the domain straight thru to my current domain? Additionally I should 301 all links? not just the main domain?

    • James Bavington

      Hey Brian. Yes it will pass on the equity of the old URL’s backlinks. Matt Cutts has stressed that a small percentage is lost with a 301, and it further dilutes if you string 301 redirects together. So technically, if you begin by 301’ing to a new domain, you ideally want to outreach to your established links to have them repointed to your new domain to maintain 100% of equity.

      • Brian Stitt

        Hey James, thanks for quick response. I guess I bought a bunch of aged domains with intent of rebuilding the content & links etc. But have not had time to do it all, as slow and learning the game. But realised by accident yesterday that maybe i can point them as this may help preserve them, then realised later that maybe the power may pass on. So when you say I should outreach to the established link you mean all the url’s of the domain and point them to where relevant?

        I wish i knew this earlier, as I have been sitting on unrealised assets without knowing this…and I guess I will see how this works shortly!

        • James Bavington

          If you just have a bunch of old domains, then I would 301 them individually onto the new domain, rather than funnelling them through the single old domain, if that makes sense. I’d make sure though that you’re happy with each domain’s backlink profile to ensure there are no unnatural links that you don’t want to inherit on your new domain. What I meant by repointing individual links related to other 3rd party websites that link to one of your old domains. I’d recommend reaching out to the webmasters to have the links updated to your new final destination URL. Hope that makes sense Brian – wish I had a whiteboard to explain properly!

          • Brian Stitt

            Great, thanks for the updated info…I think I got a hold of it! Pretty interesting stuff! Need to wait and see, and as I get time develop each site. But in the meantime maybe some extra revenue is earned from my sites by untapping their assets…
            Thanks James!

          • Brian Stitt

            So James if i point a new domain to my old site does that help give any SEO benefit if it is keyword based domain? And does it help start to age the domain? So that when you are ready to activate it as a actual site it has some ageing / or even possibly back links?

          • James Bavington

            Hi Brian, no registering brand new keyword rich domains, would have very little (if any) SEO benefit. Only 301 redirecting established domains with age and equity would pass on benefits.

          • Brian Stitt

            Ok thanks, and if it is a new domain and you 301 it, does it start its aging process? Or still a non active domain?

          • James Bavington

            Technically a domain will start ageing once it’s purchased, however the domain would need links and content to ensure Google distinguishes it as a website, rather than a parked, dormant domain. Domain age is considered a ranking factor although I believe it’s only a very weak one.

  • HelenD

    I have a well-ranked existing site and want to change it to a new domain (which will not be hosted at the same place as my existing site) I’ve been told by the new hosters (who are resellers) that I can park my existing domain (either with my existing host or the new one) and point it at my new domain and that this will have the same effect. I’m not convinced this is true and would appreciate your comments/advice.

  • Heather

    I have a question… is it possible to keep the hosting the same and just point the new domain to it. Can I create the .htaccess file to redirect the domain name if the redirect is to the same hosting IP address? Sorry if I’m not making sense… do you understand what I mean – we don’t really want to have to move our website to new hosting and leave behind one little .htaccess file to redirect. we would end up having to pay for 2 lots of hosting… if this is the only way then how long after setting up the redirect can we safely terminate that hosting and remove the redirect altogether? thanks!

    • James Bavington

      Hi Heather, take a look at my reply to Nikolaj above – this may be possible via converting the old domain to an alias of the new one.

  • Targeras

    Thanks a lot for the article.
    Still got 1 question: what should I do with robots.txt and sitemap.xml on the old website? Should I keep them the same?
    The 301 redirect from the good website is made for seo purposes and there would be page-to-page redirection only of the similar pages (titles and descriptions are different).
    Thanks again

    • James Bavington

      If you’re redirecting the entire domain, there’s no need to keep the robots.txt and sitemap.xml files around, I’d simple ensure they’re 100% on the new site, and just maintain the 301’s via the .htaccess on the old domain.

  • Nikolaj

    Hi there.

    Thanks for the article – first one I read that actually addresses a new site that might have a different URL structure. My question is the same as Heathers so I really hope you will take the time to answer it here. Can I just point the old domain to the new hosting, and set up the htaccess on the new server or do I HAVE to have a separate hosting for the old site?

    • James Bavington

      Hi Nikolaj. I’d recommend having hosting on the old domain in order to host the .htaccess file. If you simply forward/point the domain in your control panel to the new domain, all redirects will go to the homepage and you wouldn’t be able to split them out onto their counterparts on the new site.

      You could look at setting the old domain up as an alias of the new domain’s hosting (which would pull the same hosted files as your new domain), and redirect them that way? That in theory should work, and avoid having hosting on your old site, but I’ve not personally set that up and tried it on any of my sites.

  • magda

    Great,work faboulously,within seconds…thank you for sharing here this valuable tips!

  • Rehan Kashan

    hello sir after redirecting my website i can see a lot of backlinks from my old domain in google webmaster tools so what about these back links i have about 4000 back links is it BAD or normal thing?

    • Michael

      Same question I have

  • Fernando

    Hello James Bavington
    I bought an expired domain with good PA DA and redirected it to my new domain, only the home page. It was 3 days ago and I can not see the backlinks in Google Webmaster yet. How long does it take to appears in webmastertools?



  • Dean Puckering

    How long do you recommend running both domains before closing the old site?

    • James Bavington

      Hey Dean, I’d recommending leaving the old domain in place indefinitely if possible. I’d only consider taking it down once all old links and references online had changed to the new URL.

      • Dean Puckering

        Thank you!

  • Jennie Smith

    Hello James that’s a really nice article…
    but i want to ask one
    thing when i change my olddomain to newdomain then can i create
    back links from same website that i used to my olddomain Sorry if
    I’m not making sense do you understand what I mean thanks……

    • James Bavington

      Hi Jennie, I think I understand what you’re saying. If you have another website which you used to link to your website from, I can’t see any problems in creating a link to your new domain if that’s what you mean?

      • Jennie Smith

        i mean if i create some good backlinks for edu websites for my old domain so can i create new backlinks from same edu websites to my new domain. does Google didn’t consider it duplicate backlinks? if i moved my old site to new site using 301 redirection.

        • James Bavington

          If possible, I would update your old back-links after performing the 301. I wouldn’t recommend adding additional links to the new domain if it is possible to change the old ones. A small bit of link equity is lost with a 301 redirect so having links updated to your new URL is best practice.

          • Jennie Smith

            Thank you ……

  • LaurieG

    I’m currently in the process of moving several websites to one consolidated new domain, roughly 4 domains into one! eeekk!! My question is re 301 redirects, can I have more than one page from my old sites pointing to one page on the new site (via 301)?

    • James Bavington

      Hi Laurie, yes you can redirect all pages in a catch-all redirect, or manually point each page to it’s new counterpart page which is recommended. James.

  • James Bavington

    Thank you for checking out my article Rob. In my experience, if you’re changing domains anyway I wouldn’t worry too much about trying to keep the URL paths the same. Sure the 301 process is easier if they are, but if you’re potentially changing the URL structure for the better, I can’t see how that would diminish the 301 in any way.

  • Waldemar

    Hi James,

    I’ve moved to new domain, done the 301 redirects and it all looks OK.

    However, what I cannot find anywhere is: when is it save to delete old domain/website?

    After the old website doesn’t appear in the search results anymore?

    I don’t think there are many links referencing old URLs, so I don’t have to worry about that; it is just about the Google rank and when it was completely “transferred” to the new domain.


    • James Bavington

      HI Waldemar, it’s a good question. Ideally you’d leave the 301 redirects in place permanently, however if you’re confident that all old links to your old domain have been updated to the new domain, it should be fairly safe to remove the hosting and 301’s. You could consider keeping the domain to hand, and with your domain registrar simply redirect the whole domain onto your new domain without having to host an htaccess file.

  • kamran

    I’ve 2 Questions, that I did’t get answered.
    1. First, I’m doing this 301 permanent redirect on domain panel (, I clicked forward URL and selected option 301 redirect, IS This Ok? or I should do it on hosting side and use .htaccess file (for Now, I also did it on hosting, in case the DNS propagation takes time).

    2. This one is really important for me, How much time it takes for full Authority and Juice redirection, What I mean is that how much days/week/month it require so that the new domain have all the authority and link juice, and ranking.

  • Carl Reed

    Just saved me HOURS of work with those few lines of code for the
    .htaccess file, thanks! Your website if fantastic BTW I’m really

    • James Bavington

      Our pleasure Carl, glad my post helped with your work :)

  • Sean

    Hi James,
    Great article.

    I work in finance and have been told to remove my current domain name from the search results since it is no longer compliant.

    It fetched a lot of traffic and I’m worried that I’ll lose it all so I’ll need to do a 301 I think.

    I have 2 questions :
    – links
    What about the old site links – do I now have to point them at the new site? I know Google passes link equity but is it a good idea to get the links to the new site or no point?

    – URL name
    My old site has a keyword rich URL – should I make my new site domain in a similar fashion to help ranking.

  • whitney

    do you need to continue owning the previous domain in order for the 301 redirects to work or can you let that expire and someone else purchase it at some point down the road?

    • James Bavington

      Hi Whitney, yes you would need to maintain the old domain so that you can host and serve the .htaccess file with the redirects on it.

  • Sean Wilkins

    Hi – I have 2 websites – can I use 301 to take from one site to the other. I’d plan to add the exact same content to the new site. Does changing my new website name affect rank – since the old website name is keyword rich.

    • James Bavington

      Yes you can use the process in my post above to achieve this migration. If your new domain is newer and not as established, there may be a little loss in authority, but a lot of equity will be ported over if the 301 is done correctly.

  • Seranda

    Hello James,

    I am using sitebuilder and have been trying to forward 2 domain names to my preferred domain name and the associated sites but I am really struggling. Are you aware of whether or not I can use .htaccess for sitebuilder?

    • James Bavington

      Hi Seranda, I’m not familiar at all with SiteBuilder I’m afraid.

      • Seranda

        Do you know any ways aside from the standard .htaccess, php and etc?? Do you know much about html forwarding?

  • Board Kopen


    will this work also for subdomains in place on current domain? or should this excersize be repeated for those URLS seperately?


  • Mark Mars

    Thanks for this. We’ve used this process before to good effect.

    However, this time we decided to point the old domain to the same IP address (website) as the new domain and host our HTAccess file there that redirects the old page URL’s to the new ones. This all seems to work fine, however the change of address tool does not recognise our 301 redirects (step 2 of the change of address tool) so we’re wondering whether there is a reason NOT to do this or whether this is bad practice.

    This seemed reasonable and we did it so that we could cancel the hosting on the old domains. Do you have any experience of this?

  • ㅌㄹㅇㅅ

    Hello, I recently change my blogger url but I didn’t know how to use a 301 redirect code. I still have access to my old url, but what are the necessary codes I have to paste to my old/new blog’s url to be able to do a 301 redirect? And is there anyway to reclaim any of my lost positions on Google? (Google is not ranking my blog anymore and I have lost the top spots in some searches, affecting my views drastically)

  • Mike Devitt

    Hi, Thanks for the article. A really helpful read. I’ve got myself a but confused and need some help. I’ve got a site e.g. [email protected] and I have created a WordPress site on [email protected]. What I need to do is not only maintain the SEO for [email protected] but also re-direct the urls to [email protected] AND the url ‘appear’ like it is [email protected]. I’ve got the re-direct working (using .htaccess) but do not know how to make [email protected] appear as [email protected]? Any suggestions?

  • Hiroko Y.

    Hello, I am working domain change for my client website and have a question in step1- preparation part.

    I have a full access for new domain running a new hosting company, but I don’t have any access for old domain in old hosting company. Because of that, I can’t add old domain into Google Webmaster Tools. As a solution, I am thinking;

    1) Transfer old domain to new hosting company FIRST.
    2) Hosted old domain in a new hosting company. (new hosting company has one free Add-on domain.)
    3) At this point, both domains are hosted in new hosting company in which I have a full access. So I will add old domain in Google Webmaster tools.
    4) After adding old domain in Google Webmaster tools, I will set up 301 redirect for old domain.
    5) Submit change of address form from old domain account in Google Webmaster tools.

    2) and 3) are my solution to add old domain to Google Webmaster tools. Is my understanding correct? It would be great if you would give some advice. Thanks!

  • Sally Sutton

    This is a very helpful article! At first I thought this would be a daunting task, however your instructions made the process very clear!

  • Jason Cooke

    Here’s a fundamental question for you. How long do you leave it before you can scrap the OLD domain, let it expire, delete the hosting and remove the site from Google Webmaster Tools?

  • Harsha Perera

    Hi James,

    Thank you for sharing such an insightful article! If I only have a few back links that I can easily re-link to my new domain is there any SEO value in doing the 301 re-direct described above? I was hoping to just clone the site, re-link the back links and have a simple re-direct from the old domain to the the new domain home page. I hope the question makes sense as I am not very tech savvy. Any input will be most appreciated!

    Thank you,

  • James K

    Thanks this is very helpful. However, is there a modification to the htaccess code that will redirect all pages EXCEPT the index page? We want to host a new index page with specific content rather than have it automatically redirect to the new domain landing page.

  • Ali Raza

    I have old website with https, i want to move old http:// , http://www, https://, https://www to my new only http site(new domain don’t have https) . Please give me code for this redirection.