WordPress Multisite with multiple domains and redirects with one .htaccess

We run a WordPress Multisite installation with a about 15 different websites all on their own domain. On one of those sites we want to migrate to a new theme that uses custom post types and migrate some of the content to these new custom post types. Because of this migration some links will break, usually this is easily solvable with a 301 redirect in .htaccess.

The nature of a multisite install just gives us a single .htaccess and when I create a simple redirect like this:

Read More

Redirect 301 /testredirect http://www.testredirect.com

Every single domain will redirect this link to testdirect.com and not just the one we just migrated. Can we fix this in this single .htaccess or is there some other way?

Related posts

2 comments

  1. The easiest option would probably be a switch to Mod_Rewrite, as you can add conditions (RewriteCond ….) to each redirection rule eg.

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} www.testredirect.com
    RewriteRule /testredirect  /  [R=301,L]
    

Comments are closed.