title: htaccess redirect if the url does not contain a specific directory
body: <p>With htaccess I need to redirect all URLs that don't contain a specific URL path (healthcare) to a new domain while keeping the original URL intact. </p>
  
  <p>Example:</p>
  
  <p>healthcare.domain.com/anydirectory/anything.html</p>
  
  <p>should redirect to</p>
  
  <p>staging.domain.com/anydirectory/anything.html</p>
  
  <p>but any URL containing /healthcare should not get redirected. As in healthcare.domain.com/industries/healthcare/customers.html should not be redirected.</p>
  
  <p>Both domains are on the same server and healthcare.domain.com is pointed to same root as staging.domain.com. They wanted to be able to access the following page staging.domain.com/industries/healthcare/ at healthcare.domain.com. I setup healthcare.domain.com as a new subdomain pointing its root to the same root as staging.domain.com. I then setup a redirect in the htaccess for healthcare.domain.com to redirect to healthcare.domain.com/industries/healthcare which works perfectly, but if you click anywhere else on the site outside of /industries/healthcare/ I need to bring the user back to staging.domain.com/whatever</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^healthcare\.domain\.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.healthcare\.domain\.com$
  RewriteRule ^/?$ "http\:\/\/healthcare\.domain\.com\/industries\/healthcare\/" [R=301,L]
  
  RewriteCond %{HTTP_HOST} ^healthcare\.domain\.com$ [NC]
  RewriteCond %{REQUEST_URI} !/healthcare/ [NC]
  RewriteRule ^(.*)$ http://staging.domain.com/$1 [L,R=302]
  </code></pre>
  
  <p>But the above always returns <a href="http://staging.domain.com/index.php" rel="noreferrer">http://staging.domain.com/index.php</a></p>