Australia's Leading Digital Marketing Experts. T. 1300 235 433  |  Aggreagtion Enquires Welcome

Redirect An Old WordPress Website To Your New Website

If you move your WordPress website from one domain to another (as we have recently done), and you have kept existing URLs etc (so, you have kept your old database across and made the necessary changes), this .htaccess code will redirect all your old requests to the new website.

1
/*
2
    Redirect An Old WordPress Website To Your New Website
3
    http://www.beliefmedia.com/code/wp-snippets/redirect-htaccess
4
*/
5
 
6
 
7
RewriteEngine on 
8
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

Add the code to your .htaccess file without white spaces. When altering the file, always back it up first.

Like this article?

Share on facebook
Share on Facebook
Share on twitter
Share on Twitter
Share on linkedin
Share on Linkdin
Share on pinterest
Share on Pinterest

Leave a comment