How To Correctly 301 Redirect Your Domain

Created by Haider Ali, Modified on Fri, 24 Oct at 12:41 AM by Haider Ali

Ever decide to pickup and move your website to a new domain?


What about buying a similar domain and needing to redirect it to your current website?


I’ve personally started two startups before using different TLDs than the .com. Both names I wanted were registered and I didn’t want to fork out thousands of my startup budget until I at least had proven my minimum viable product (MVP) as successful.


Therefore once I was able to afford the .com, it was essential to pass my search engine rankings!


How To Redirect Preserving Search Engine Rankings


If you have already developed your website and are wanting to move everything to a new domain, you need to do a couple of things:


  • Move your content


  • Setup 301 redirects from the old website to new


Move Your Content


Moving your content shouldn’t be to hard. If you’re using WordPress you can easily export all of your post data and re-import it into your new website. You could also simply copy over the existing database as is and edit your wp options table to reflect the new domain.


To keep things simple, I also recommend retaining a similar URL structure on the new domain.


For example, if you were using https://old-domain.com/post-name-goes-here/ it would be easiest to keep https://new-domain.com/post-name-goes-here/.


While it’s still possible to change the URL structure, this will ensure you don’t run into any errors.


Setup 301 Redirects


A 301 redirect tells the search engines the content has been moved permanently allowing for your search engine rankings to pass through to the new domain. This also carries over your existing backlinks.


You can setup a 301 redirect by creating or modifying the .htaccess file in your root public_html directory. You would want to format it like this:


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]


This would take into consideration that you have preserved the link structure to the old content.


If you have any questions or need our team to take a look to ensure you’re redirecting your website correctly, feel free to let us know!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article