Permanently Redirect Your WordPress Website to a New URL

Whew!

I recently copied a client’s WordPress website from one domain to another.  In order to retain SEO for the old website, I needed to redirect every page on the old site to the same file on the new site.

In order to do that, I added the line

RewriteRule ^(.*)$ http://newsite.com/$1 [R=301,L]

directly after the code

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

in the old site’s .htaccess file.  It works great immediately.

Share Button

Leave a Reply

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

Back to top