A little text file on an Apache Web server adds power to your site. Meet .htaccess and see what it can do. If you have an Apache-based Web server or have Apache installed on your PC, you can quickly try out .htaccess with the examples given in this article from the Web Design Guide at InformIT that Meryl hosts.
.htaccess (a period appears before the name) is the little engine that could in the host directory. With this simple text file, you can make configuration changes to the server or change the directives (instructions) for a directory and its sub-directories. Those custom 404 pages? .htaccess is responsible.
.htaccess is located in the directory where you want the changes to occur. An .htaccess file located on the main directory affects everything on your Web site. If you want to change the directives for one directory and not the whole site, that directory gets its own .htaccess. .htaccess files in specific directories get priority over the ones “above.”