.htaccess is a resourceful file that can allow or deny access to your website or a folder or files in the directory in which it is placed by using order, allow and deny keywords.
Options All -Indexes
That’s it. Now you know how to Allow or Deny access to your website using .htaccess.