Hiding folders on webspace url

Hello there ~

How do I protect a folder on my webspace so the contents cannot be viewed ( such as the /cgi-bin/ folder where it says " Forbidden you don't have permission to access). I have photos and such of family and friends I do not want the whole world to view. I noticed on the web address you can see the extension and view all my contents in my folder through that. Please let me know if there is a way to protect this. Any information is kindly appreciated. Thanks!

Hi, the correct way is to use a .htaccess file, google for it