title: .htaccess: deny direct access to files in specific case
body: <p>I have these files in my webroot: index.php (login page), login.class.php, styles.css and then a directory "accounts", in that directory there are some css files, index.php and formprocess.php</p>
  
  <p>So when a user visits site (index.php) he is asked to log in. If he enters correct username and password: he is redirected to accounts/index.php. If he enters wrong: he IP is blocked.</p>
  
  <p>But this login page can be bypassed by directly visiting accounts/index.php. So I want to prevent that.</p>
  
  <p>What I want is: A user should only have access to 'accounts' directory and its file if he has logged to the site. Direct access should give 403 error.</p>
  
  <p>Can anyone tell me how to do that using .htaccess or php?</p>
  
  <p>Any help would be appreciated :)</p>