HOWTO: Redirect WordPress with .htaccess

I’ve just switched from to…which may or may not have been the best idea SEO-wise, but I couldn’t help myself.

Anyway, here’s a regex recipe that might be useful for someone else who wants to redirect a domain while still being able to access the old wordpress admin area. If your url structure is the same for both sites, links that point to posts on the old site should automagically redirect to the new.

Just put this in the .htaccess file for your old domain:

RewriteCond %{REQUEST_URI} !/(wp-login\.php|wp-admin/|wp-content/|wp-includes/).*
RewriteRule (.*)$1 [R=301,L]

One thought on “HOWTO: Redirect WordPress with .htaccess

Leave a Reply

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