Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Security : Education - Tutorials
Securing your Web server
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
3. User authentication
  


The performance penalty of .htaccess page 11 of 12


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>

Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact