title: Wordpress Multisite Domain Redirects
body: <p>I have a Wordpress multisite with a primary domain that is used for admin site management and then hundreds of other sites that each have their own unique domain (NOT a subfolder or subdomain of the primary site). </p>
  
  <p>I need to redirect each site to its corresponding landing page on our main site. I am programmatically generating these redirect rules since there are hundreds of redirects that need to be set up. I am then adding those redirect rules to one master .htaccess file at the document root.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^(.*)?firstsite.com [NC]
  Redirect 301 / https://newsite.com/1234/ 
  
  RewriteCond %{HTTP_HOST} ^(.*)?secondsite.com [NC]
  Redirect 301 / https://newsite.com/5678/
  </code></pre>
  
  <p>What I'm seeing is that it is redirecting all traffic from any of the sites to the first "Redirect 301" address (<a href="https://newsite.com/1234/" rel="nofollow noreferrer">https://newsite.com/1234/</a>). Presumably because I'm doing "Redirect 301 /" which is redirecting the document root of the entire Wordpress multisite instead of the root of the "RewriteCond" domain specified.</p>
  
  <p>How do I set up essentially a conditional redirect based on the domain being accessed? </p>
  
  <p>I should mention that I do not have Nginx installed on the server.</p>