title: 301 .htaccess redirect with other domains in web root
body: <p>Normally if I wanted to redirect a domain and all pages in that domain to another new domain, I'd use this in my .htaccess file:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteCond %{HTTP_HOST} !example.com$ [NC]
  RewriteRule ^(.*)$ http://new-example.com/$1 [L,R=301]
  </code></pre>
  
  <p>But I have an account with a host that uses cpanel and sets up addon and subdomains to be included in the web root of the account's primary domain, instead of outside. Unfortunately this htaccess code then affects all of those other domains too. How can I write this so that it only affects example.com and not the other addon domains of the account, but STILL redirect all files in the primary domain?</p>