.htaccess File IntroductionPritesh
Being an web developer we might come across the term .htaccess file. Many of the web developers are talking about the .htaccess file. In this tutorial we will be discussing about the .htaccess file.
.htaccess File Introduction
- .htaccess file is simple ASCII File written in the Notepad++ or using any editor.
- .htaccess file can be considered as configuration file which is used on web servers running on Apache.
- .htaccess is file extension rather than a file.
- .htaccess file is detected by the Apache Web server and all the configurations specified in the .htaccess file will be executed by the Apache server.
- .htaccess is file is used for enabling or disabling the certain features provided by Apache in order to fulfil the user requirement.
Features of .htaccess File
.htaccess File provides many features that are useful for the web developers and many bloggers. Below are some of the features provided along with .htaccess file –
- Adding MIME types
- Preventing hot linking of your images and any other file types
- Preventing directory listing
- Enabling SSI via htaccess
- Providing Error Documents
- Password protection
- Blocking users by IP
- Blocking users/sites by referrer
- Prevent viewing of .htaccess itself
- Blocking bad bots and spam boats
- Changing default directory page
Creating .htaccess File
.htaccess File can be created using the simple steps. Firstly you need to login to the cPanal
After the successful login we need to open the file manager by clicking on the file manager icon.
Now after successful login we need to create the new file and provide the name as shown in the above screenshot.