title: Restricted access using .htaccess in Docker container
body: <p>I'm literally at the end of my knowledge. I've set-up a few server and sometimes I've used .htaccess for restricted access.</p>
  
  <p>It's always working except for my latest work. I have an Debian instance running inside of a Docker container with Apache2.</p>
  
  <p>Adding a .htpasswd-File work's fine. Except that the part in my .htaccess doesn't work.</p>
  
  <p>/var/www/.htaccess exists
  /var/www/.htpasswd exists</p>
  
  <p>code inside my .htaccess:</p>
  
  <pre><code>AuthType Basic
  AuthName "Members Only"
  AuthUserFile /var/www/.htpasswd
  require valid-user
  </code></pre>
  
  <p>There exists a file <code>_index.html</code> I can access this file using <a href="https://sub.domain.com/_index.html" rel="nofollow noreferrer">https://sub.domain.com/_index.html</a>. That's why I know that /var/www is my entry point for accessing my website.</p>