title: Excluding a subdomain from .htaccess mod_rewrite rules?
body: <p>I'm not too familiar with .htaccess files, and I'm trying to exclude a subdomain (something like <code>dev.example.com)</code> from the following rewrite rule that's already in place:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
  RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  </code></pre>
  
  <p>This rule prohibits anyone from just entering <code>example.com</code> or <code>http://example.com</code> and forces the desired presentation of the URL, <code>http://www.example.com</code>.</p>
  
  <p>I've tried a few options of excluding a subdomain from this rewrite rule, but to no avail. Each of the directories on the site have their own .htaccess file, but it seems this one is still taking precedence. Any ideas? Thanks!</p>