There may come a time when you want to change server behaviors for a specific path on your web server. Often times this becomes necessary if you host web sites that the customer wants to manage externally.
There are only a few small changes required:
- In your httpd.conf file…
# use .htaccess files for overriding,
# and never show any file starting with .ht
<files ~ "^\.ht">
Deny from all
- The for the paths (or virtual hosts, you’ll need to add this line):
- Add the appropriate .htaccess files where needed.
DISCLAIMER: This technique CAN result in performance improvements, but should be put in your main server configuration file (httpd.conf), rather than in .htaccess files. .These files, by their very nature, cause performance degradation on your website, and so should be avoided whenever possible as they require an increase in file I/O (reads) on the server.