What is .htaccess file?

Deepu picture Deepu · Nov 1, 2012 · Viewed 100.7k times · Source

I am a beginner to Zend framework and I want to know more about the .htaccess file and its uses. Can somebody help me?

I found an example like this:

.htacess file

AuthName "Member's Area Name"  
AuthUserFile /path/to/password/file/.htpasswd  
AuthType Basic  
require valid-user  
ErrorDocument 401 /error_pages/401.html  
AddHandler server-parsed .html  

Answer

Amber picture Amber · Nov 1, 2012

It's not part of PHP; it's part of Apache.

http://httpd.apache.org/docs/2.2/howto/htaccess.html

.htaccess files provide a way to make configuration changes on a per-directory basis.

Essentially, it allows you to take directives that would normally be put in Apache's main configuration files, and put them in a directory-specific configuration file instead. They're mostly used in cases where you don't have access to the main configuration files (e.g. a shared host).