Why does the use of .htaccess files exact a performance penalty? In addition to the time required to read the configuration from this file each and every time a request is made, the server also must ensure there are no other overriding access files contained elsewhere on the filesystem. For example, let's say a client requests access to the file /home/httpd/testsite/htdocs/index.html and there is an .htaccess file present in this directory. Apache searches for the following:
/.htaccess
/home/.htaccess
/home/httpd/.htaccess
/home/httpd/testsite/.htaccess
/home/httpd/testsite/htdocs/.htaccess
As you might imagine, between the initial file parse and this multiple search mechanism, the server slows down rather dramatically. You can turn multiple searching off with the following directive:
<Directory />
AllowOverride None
</Directory>