Does is it only used mainly for 301 redirect? or for other purposes? can anyone please tell me the other use of .htaccess? Thanks.
Well, you can use .htaccess to block , allow certain ip address that you dislike. Another common use for ".htaccess" files is to require that a user id and password be provided to access some part of a web site Hope this helps!
.htaccess gives the opportunity to rewrite the dynamic urls (contain ? = symbols) into a more search engine friendly static form. This is one of the biggest advantages of it.
You can also do things like... if someone requests a bad url instead of getting a 404 they get automatically taken to your root site (or specified site url).
You can do all sorts of things like switch your domain from non www to www, 404 page generation, 301 redirect, etc, etc. For how to do the www/non www thing check the Apache forums here or read: http://www.sonicko.com/blog/2007/03/19/using-htaccess-to-manage-your-site/
So it means it is a text file in your directory where you put all the necessary security and other stuffs to manage your website....