I've got a directory on my small webserver. It doesn't come with an index page. then when u access your directory using a internet browser it lists the files inside it. Now i wish to produce a htaccess file that may block your directory listing to ensure that whenever you can get on through the internet browser, the files within the directory wouldn't be listed but would have the ability to access the files by appending the title from the file you want to accessibility url which makes it a complete part towards the file. Even the htaccess file should have the ability to restrict access from basically files having a particular extention. Thanks.

Options -Indexes

Order allow,deny
Deny from all

<Files "*.gif">
    Allow from all
    Deny from none
</Files>

You are able to switch off the file listing for the directory within the directory's .htaccess with

Options -Indexes

OR

You can just put a clear index.html file within the directory you need to safeguard.

Within the .htaccess file inside your directory just put

Options -Indexes

As mentioned before.

Edited to get rid of the incorrect htaccess setting. Again sorry