Wednesday, 8 October 2014

Security for online webfolders using .htaccess

Today I am going to tell you about .htaccess file, this is very basic thing to hide folder file lists by using htaccess, when we are holding some file in our website that files are listed as file in web folder. So that is hack-able by visitor or hackers, so we have to make secure our web folder files. for that we are going to use htaccess.

What is .htaccess?
Simply put, they are invisible plain text files where one can store server directives. Server directives are anything you might put in an Apache config file (httpd.conf) or even a php.ini**, but unlike those "master" directive files, these .htaccess directives apply only to the folder in which the .htaccess file resides, and all the folders inside.
A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration.

How to create htaccess file.?
open notepad and save the file as the extension of ".htaccess" that file is called as htaccess file , it is hidden file do you want to see this file prees Ctrl+h

Default files list type in web folder.

like the above "test" folder will show the files, So here we are going to disable the files. for that we are going to use the .htaccess file.

# Disable Directory Browsing
Options All -Indexes
after we use the above htaccess file the folder will be like,

No comments:

Post a Comment