What is .htaccess file and How to use .htaccess file?

What is .htaccess file and How to use .htaccess file?

.Htaccess file:

.htaccess file are the configuration files in order to modify the configuration of Apache web server on a per directory bases. We can also generate our .htaccess file manually. If you like to protect your website with a password then you will need to have .htaccess file.

.htaccess file is commonly used for security restrictions for a directory. It contains a file named .htaccess in which usernames and passwords are stored. By placing the .htaccess file in different locations will affect the functioning of site. If you put it in root directory then whole site will be affected but if it is located in /index directory then only that directory will be affected. Like .html and .txt .htaccess is not a extension file. It is simply a ASCII text file having name .htaccess and can be written with a simple text editor.

Usages of .htaccess file:

.htaccess is a powerful feature to control the various aspects of a site. During the writing of this file we should always keep this in mind that .htaccess is very sensitive. Even a single . (dot) or an extra # may destroy all. So we should be very careful in writing .htaccess file.

This file is used as a security restriction and to avoid security risks. For example if someone types the name of a directory then whole lists of files in that directory will be shown. If you like that your directory remain hidden, then you can do this by a simple command in .htaccess.

Options EXecCGI Includes

Includes No EXEC Symlinks If Ownermatch-index.

As it controls the various aspects you can set different features for a site.

· We can make our site password enable

· You can set time zone for your site

· Can redirect pages

· Can protects the various links

· Block or deny IPs.
Author
Jaishree
Views
1,707
First release
Last update
Rating
0.00 star(s) 0 ratings
Top