What are .htaccess files?

Simply put, they are invisible plain text files where one can store server directives. Server directives are anything you might put in an Apache config file (httpd.conf) or even a php ini file (php.ini), but unlike those "master" directive files, these .htaccess directives apply only to the folder in which the .htaccess file resides, and all the folders inside.

This ability to plant .htaccess files in any directory of our site allows us to set up a finely-grained tree of server directives, each subfolder inheriting properties from its parent, whilst at the same time adding to, or over-riding certain directives with its own .htaccess file. For instance, you could use .htacces to enable indexes all over your site, and then deny indexing in only certain subdirectories, or deny index listings site-wide, and allow indexing in certain subdirectories. One line in the .htaccess file in your root and your whole site is altered.

There's a small performance penalty for all this .htaccess file checking, but not noticable, and you'll find most of the time it's just on and there's nothing you can do about it anyway, so let's make the most of it..

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

I am receiving a 500 internal server error. What do I do?

The 500 Internal Server error can be caused by many different things. If you receive this error...

How do I backup my entire site in cPanel?

Entire accounts can be backed up by doing the following: 1. Log into your cPanel and click the...

Ports that must be open to run cPanel behind a firewall / IPTables

20 ftp tcp inbound/outbound21 ftp tcp,udp inbound/outbound22 ssh tcp inbound25 smtp tcp...

Quotas in WHM

ssh into the server then issue:/sbin/quotaoff -av/sbin/quotacheck -augvm/sbin/quotaon -av

Running exim on a different port

Log into WHM and click on "Service Manager" under the Service Configuration grouping....