.htaccess file is very important in the Apache server.
The real name of this file is Apache’s directory-level configuration file .
There are three major usages of .htaccess.
- Authorization, authentication: .htaccess files are often used to specify the security restrictions for the particular directory, hence the filename “access”. The .htaccess file is often accompanied by an .htpasswd file which stores valid usernames and their passwords.
- Customized error responses: Changing the page that is shown when a server-side error occurs, for example HTTP 404 Not Found.
- Rewriting URLs: Various server-side PHP scripts use .htaccess to rewrite “ugly” URLs to shorter and prettier ones.
The authorization can restrict the right of access to different directory or by different user right.
Customized error page is also very important for the site which want to provide better user experience.
Rewriting URLs, is used so popularly on all kind of PHP drived programs, such as WordPress.
More detailed usage of .htaccess, please go to Apache Tutorial, and Httpd wiki.




0 Comments on “htaccess file”
Leave a Comment