title: htaccess limit the url access to subdomains
body: <p>So basically I have the following public_html structure:</p>
  
  <pre><code>/main
  /subdomains
  </code></pre>
  
  <p>So far I have managed to make it so one cannot access /subdomains directly by setting:</p>
  
  <p><strong>www.site.com/subdomains</strong></p>
  
  <p>However lets say I have a subdomain called projects:</p>
  
  <p><strong>projects.site.com</strong></p>
  
  <p>In a folder:</p>
  
  <p><em>/subdomains/projects/</em></p>
  
  <p>Now if one knows the url one can access the projects folder via:</p>
  
  <p><strong>site.com/subdomains/projects.</strong></p>
  
  <p>What I want to do is prevent this behaviour so the only way to access the subdomain is via the proper subdomain url: <strong>projects.site.com.</strong></p>
  
  <p>If this can be done via <em>Cpanel</em> then great but I am not shy about using <em>.htaccess</em> to do it.  Just bear in mind when writing your answer that I am not excatly fluent yet so detailed answers please.</p>