title: mod_rewrite RewriteCond - is NC flag necessary for just domain part? And some more
body: <p>I have seen many times in <code>htaccess</code> these type of rules :</p>
  
  <pre><code>RewriteCond %{HTTP_REFERER} !^http://www.domain.it$ [NC]
  </code></pre>
  
  <p>or</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} !^www\.domain\.it$ [NC]
  </code></pre>
  
  <p><strong>Why is the <code>NC</code> flag necessary, when checking only the domain part?</strong></p>
  
  <p>I noticed <strong>browsers always converts uppercases in domain names into lower cases</strong>, so I don't see what the <code>[NC]</code> flag is usueful for in this case.</p>
  
  <p>I mean if we check the remaining part of the url I understand the need for <code>[NC]</code> flag cause on Unix systems <code>www.domain.com/index.html</code> is different file than <code>www.domain.com/INDEX.HTML</code> but I don't understand the need of <code>NC</code> flag when we check only the domain part in the RewriteRule.</p>
  
  <hr>
  
  <p>Since you took the time to read the above, <strong>let me ask also one minor question</strong> not directly related to <code>NC</code> flag, but still related to <code>RewriteCond</code></p>
  
  <p>Both <code>RewriteCond</code> shown above work well, I thought only the one with slash before dots would work (<code>!^www\.domain\.it$</code>) because <strong>the dot without a slash should mean <em>'any char'</em> in regexp whilest the <code>\.</code> means the dot char</strong>, but surpraisingly also the other one works well, do you know why?</p>