Htaccess
An htaccess file is an amazing feature that allows control through a text file called .htaccess and is used to control web server (Apache) behavior for your web site.
How to create an .htaccess File and what to do with it.
.htaccess is a text/ascii file, you must create or modify it using a basic text editor. Upload it using FTP to the directory of your choice. Upload it in ASCII mode. If you want the .htaccess file to apply to your entire site, upload it to your root web directory. This is the same directory which holds your home page. Please note that your FTP software will not show an entry for .htaccess on the server side. Files starting with a '.' are consider 'hidden' files on Linux servers.
Ensure sure your text editor did not add an extension. Uploading a filed called say .htaccess.txt would not work. Remove the .txt extension in this example, you can use your ftp program to rename the file and remove the extension.
Ensure you use correct file permissions. The permission to give it is 644. This stands for owner read/write permissions and read only for others.
Please note : using .htaccess can come with a price in performance. i.e many htaccess rules can slow your server performance down substantially.
If your .htaccess file has even a single error it in, it may cause error messages to be generated when you try to view your web site.
.htaccess files in sub-directories affect the sub-directory only
In this event, remove the .htaccess file from your web hosting acount to restore things back to normal. You could also overwrite it with a blank .htaccess file. Always make a back of your .htaccess file or be able to quickly delete it, or any changes you make, otherwise your whole website may become unusable
Note : Please be aware that many .htaccess rules can and will effect the performance of your server.