Redirect Old Domain to New Domain via .htaccess

When you are moving your website to a new domain name you need to ensure that you are correctly redirecting all your old pages so that you don’t loose any SEO benefits from existing links. If you fail to do it properly you will probably notice a huge decrease in traffic from organic sources.

If you have not made any changes to your overall site structure and the URL’s are staying the same just on a new domain name, you can add the following lines to your .htaccess file located at the root of your old domain:

<IfModule mod_rewrite.c>
     RewriteEngine on  
     RewriteRule ^(.*)$ https://www.newdomain.co.uk/$1 [R=301,L] 
</IfModule>

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.