title: excluding a subdomain from htaccess redirect
body: <p>I've searched stackoverflow before submitting this thread but I had no luck :-S</p>
  
  <p>I've a website with a complex .htaccess file as below:</p>
  
  <p>This part is for redirecting (X.2nate dot com --> 2nate dot com/api/x) and it's working well</p>
  
  <pre><code>########### API Redirection Section ##########
  
  RewriteEngine On
   # Extract the subdomain part of domain.com
  RewriteCond %{HTTP_HOST} ^([^\.]+)\.2nate\.com$ [NC]
   # Check that the subdomain part is not www and ftp and mail
  RewriteCond %1 !^(www|ftp|mail|charge)$ [NC]
   # Redirect all requests to the original url  /blog
  RewriteRule ^.*$ https://2nate.com/api/%1 [L]
  </code></pre>
  
  <p>This part is for redirecting non-SSL requests to SSL protocol:</p>
  
  <pre><code>RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  </code></pre>
  
  <p>And this part is for redirecting with WWW to no-WWW address:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^www\.2nate\.com$
  RewriteRule ^/?$ "http\:\/\/2nate\.com\/" [R=301,L]
  </code></pre>
  
  <p>and the problem is:</p>
  
  <p>when I was trying to access "charge" dot mywebsite dot com (charge is a real subdomain in my host) I cannot access the related page and it's redirecting to main page!</p>
  
  <p>I think problem is with this part:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^www\.2nate\.com$
  RewriteRule ^/?$ "http\:\/\/2nate\.com\/" [R=301,L]
  </code></pre>
  
  <p>Because when I remove this part, everything is OK (except redirecting to non-WWW).</p>
  
  <p>Any helps are appreciated.</p>