htaccess. - How to restrict operations with any files except index.php

Please help us to resolve the jam: we need to restrict search, access and other operations with any files except index.php using the htaccess. For example we have a products/ catalogue
Required to restrict access to any file except the index one.
So if some visitor tryes to access through the products/ or products/index.php, it should work fine, but if say, thro products/comp.php - then not. We tried to use the following code:

<FilesMatch ".">
order allow,deny
deny from all
</FilesMatch>

<FilesMatch "index\.php">
order allow,deny
allow from all
</FilesMatch>

Now it works only if the products/index.php is specified
How can we make it work with the products/ without the index file specified?
Thanks in advance!

 

 

 

 

Top