title: Checking if a file is behind htaccess
body: <p>Is there anyway to check if a file, in my case an image file, is behind htaccess?</p>
  
  <p>I am trying to echo out the path to an image src where in some cases the file will be behind an htaccess required authentication. In that case I want it to display nothing. Right now, it presents the login/password prompt because I am referencing that image.</p>
  
  <p>Sample:</p>
  
  <p>folder2 is behind required authentication</p>
  
  <pre><code>$folders = ['folder1','folder2'];
  
  foreach($folders as $folder){
  
      if(is_readable($folder.'/thumb.png'))
          echo "&lt;img src='{$folder}/thumb.png' /&gt;";
      else
          echo 'img not found';
  
  }
  </code></pre>
  
  <p>I have tried is_readable and file_exists, both seem to still present the prompt.</p>
  
  <p>edit: htaccess file</p>
  
  <pre><code>AuthType Basic
  AuthUserFile /home/.../.htpasswd
  AuthName "Please Log In"
  require valid-user
  </code></pre>