title: codeigniter: protect controller with htaccess
body: <p>I would like to protect 1 controller from my Codeigniter project with the following htaccess code placed in the root:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php/$0 [PT,L]
  
  &lt;Files admin&gt;
  AuthName "admin"
  AuthType Basic
  AuthUserFile /home/domain/domains/domain.nl/.htpasswd/public_html/.htpasswd
  require valid-user
  &lt;/Files&gt;
  </code></pre>
  
  <p>When i go to domain.nl/admin i do get a prompt asking for the credentials. But when i click cancel it still proceeds to the admin page. How can i fix this?</p>