Skip to content

How to 301 Redirect WordPress Posts To New Domain

The 301 Redirect is considered as a permanent redirect compared to a 302 redirect which is temporary. Therefore when moving wordpress to a new domain, it is a good idea to redirect all the posts to the new domain.

This way all the search engine records will be kept intact and this means you won’t lose any traffics / hits to the website.

This doesn’t mean redirecting from to, it will also redirect every single URL associated with to

For instance, if a user is looking for a particular post and goes to, they will be redirected to the corresponding post on is an example of one of the most popular post on the site…

When users clicks on the above link, they will be automatically redirect to

This way, the user won’t notice the domain change because it is 99% directed via search engine or linked URL.

This method is also a good way to let GoogleBot to know that the domain has been moved permanently from to

Here is the code below and I used which goes into the .htaccess file. All you got to do is to replace the URL to make it work with your own domain.

# BEGIN WordPress<br />
RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^<br />
RewriteRule (.*)$1 [R=301,L]<br />
# END WordPress<br />
comments powered by Disqus