Setting up search engine-friendly domain redirects

3 min read

Whatever changes or modifications we wish to make to our website, it is essential in every single case to take search engine optimisation (SEO) into account, because however much people try to push it into the background in the age of AI, SEO remains one of the key cornerstones of a successful website.

This is unlikely to change in the future, which is why it is important to bear these principles in mind even when carrying out such a basic task as domain redirection. How can we implement search-engine-friendly domain redirection in practice? Below, we provide some useful advice and specific solutions!

You really need to pay close attention to duplicate content

Whether you’re performing a site migration or there’s some other reason behind the domain redirection, you must always bear in mind that Google really doesn’t like duplicate content, so the most important thing is to do everything in our power to avoid it.

Of course, domain redirection is merely the final step in the whole process, so it’s worth being aware of the entire migration process – and even more so of the options for automatically redirecting internal links – because if we make a mistake here, we could completely ruin our website; that’s why it’s advisable to entrust at least that part of the process to a specialist.

It is interesting to note, however, that in our experience, most website owners do not actually have a problem with the migration steps themselves, but rather with setting up a search-engine-friendly redirect from the old domain name to the new one.

It is very important to always avoid content duplication in the subheading. This is because, whether using WordPress or a bespoke website, it is easy to copy the website from the old domain to the new one exactly as it is.

In this case, however, the search engine will see the same content on two different domains, which is the worst-case scenario from a search engine optimisation perspective. The solution is, as a first step, to delete all files associated with the old domain from the hosting account, and only then to create the new site from a backup.

Once we’ve finished this, all that’s left is to set up the search-engine-friendly domain redirect!

Video: Processing 301 redirects (Google Search Central)

How to ensure your domain redirect is SEO-friendly

A very common mistake when it comes to domain redirection is that many people only redirect the homepage – and even do that incorrectly. If you want a search engine-friendly solution, we always recommend using a 301 redirect, which requires a working mod_rewrite module; however, this isn’t a problem in 99 per cent of cases.

If the storage space under the old domain is now empty, create an .htaccess file there that will work for both WordPress and custom-developed websites. This file must contain the following code (replacing the details with those for your own domain):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^regidomainnev.hu$ [OR]
RewriteCond %{HTTP_HOST} ^www.regidomainnev.hu$
RewriteRule (.*)$ http://ujdomainnev.hu/$1 [R=301,L]
</IfModule>

Once this has been uploaded and applied, the search-engine-friendly domain redirection is complete. What will we see? If we’ve done everything correctly, when we type the old domain name into the browser and try to open it, we’ll be automatically redirected to the new domain name; what’s more, this will work for subpages too, even if someone finds us via Google.

The latter is the key point, as this method ensures that search engine rankings are maintained and do not lose their value!

Back to the blog