I had a website where users can upload important file to share. i used one of the option provided by web host in the cp called, 'Secured folder'. so other people on the net cannot access the file.
Well, recently the option no longer supported, and i had to look around on the net to find a simpler solution other than subscribing to an 'additional services'.
so i found one, which is this.
basically just create a file called .htaccess (note that.htaccess is the extension, if you create .htaccess.php for examples, it wont work) with the code above and place it inside the folder that you want to protect.