title: Zend - Deny access to CSS, JS, Image files
body: <p>All,</p>
  
  <p>I have the following Zend application structure:</p>
  
  <pre><code>helloworld
   - application
       - configs
       - controllers
       - models
       - layouts
   - include
   - library
   - public
      - design
         -- css
             -- site.css
         -- js
             -- global.js
         -- images
             -- siteheader.gif
             -- sitefooter.gif
      - .htaccess
      - index.php
  </code></pre>
  
  <p>My .htaccess file in public folder looks like this:</p>
  
  <pre><code>Options -MultiViews
  
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} -s [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  RewriteRule ^.*$ index.php [NC,L]
  </code></pre>
  
  <p>My document root points to the "public" folder. Currently, if the user visits a directory level URL, (Ex: <a href="http://localhost/design" rel="nofollow noreferrer">http://localhost/design</a>  or localhost/css) , my .htaccess file above make sure to show him the "Access Forbidden" page. But if he visits the file level URL, (Ex: <a href="http://localhost/design/css/site.css" rel="nofollow noreferrer">http://localhost/design/css/site.css</a>), it shows him the CSS file or the js file or PHP file..</p>
  
  <p>How can I make sure to lock file level access for the above file types, if accessed directly from the URL? Since my application is JS intensive, I want to protect it from users looking at it.</p>
  
  <p>Thanks</p>