PHP Script that finds .htaccess within a specified directory

The following script iterates through the directory structure of a website, builds, then displays an array of paths to hidden files (e.g .htaccess files)

Download the script

It is useful to be able to find hidden files, because many FTP programs hide them.
See my related blog post about this issue.

——-

Update - Oct 2008

It is worth noting that Apache runs more slowly if it has to look for an .htaccess file in each directory involved in each request (depending on the AllowOverride settings).

In most cases, it is possible to avoid having a large number of .htaccess files littered throughout the public web root folder (the folder that might be called, say, htdocs).
One set of Apache directives wrapped in appropriate <Directory> directives (and saved in one public root level .htaccess file - oops - just realised - you cannot use the directory block in an .htaccess file ) can do the same job as having these directive spread out in a plethora of .access files littered throughout lower directories.

More information:

See: “The Apache Cookbook” published by O’Reilly - (Chapter 11 - Recipe: 11.7 - ‘Minimizing the performance impact of .htaccess files’ )

Or: http://httpd.apache.org

Leave a Reply