Friday, December 19, 2014

Apache .htacess - Disable directory listings

To prevent directory listings, create a .htaccess file following the main instructions and guidance which includes the following text:

 IndexIgnore *  

To prevent listing '.zip' files, create a .htaccess file following the main instructions and guidance which includes the following text:

 IndexIgnore *.zip  

eg: cakephp webroot .htaccess:

 <IfModule mod_rewrite.c>  
   RewriteEngine On  
   RewriteCond %{REQUEST_FILENAME} !-d  
   RewriteCond %{REQUEST_FILENAME} !-f  
   RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]  
   IndexIgnore *  
 </IfModule>  

No comments:

Post a Comment