What is the use of htaccess?

In several web servers (most commonly Apache), .htaccess (hypertext access) is the default name of a directory-level configuration file that allows for decentralized management of web server configuration. The .htaccess file is placed inside the web tree, and is able to override a subset of the server’s global configuration; the extent of this subset is defined by the web server administrator.

Uses :
1) .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 a .htpasswd file which stores valid usernames and their passwords

2) Servers often use .htaccess to rewrite long, overly comprehensive URLs to shorter and more memorable ones.

3)Use allow/deny to block users by IP address or domain. Also, use to block bad bots, rippers and referrers. Often used to restrict access by Search Engine spiders

4)Changing the page that is shown when a server-side error occurs, for example HTTP 404 Not Found.

5) Enable server-side includes.

6) Directory listing , Control how the server will react when no specific web page is specified.

7) .htaccess files allow a server to control caching by web browsers and proxies to reduce bandwidth usage, server load, and perceived lag.

8 ) Instruct the server how to treat different varying file types.