Table of Content

.htaccess File Introduction



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

  1. .htaccess file is simple ASCII File written in the Notepad++ or using any editor.
  2. .htaccess file can be considered as configuration file which is used on web servers running on Apache.
  3. .htaccess is file extension rather than a file.
  4. .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.
  5. .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 –

  1. Adding MIME types
  2. Preventing hot linking of your images and any other file types
  3. Preventing directory listing
  4. Enabling SSI via htaccess
  5. Providing Error Documents
  6. Password protection
  7. Blocking users by IP
  8. Blocking users/sites by referrer
  9. Prevent viewing of .htaccess itself
  10. Blocking bad bots and spam boats
  11. Changing default directory page
  12. Redirects

Creating .htaccess File

.htaccess File can be created using the simple steps. Firstly you need to login to the cPanal

login to cpanel

After the successful login we need to open the file manager by clicking on the file manager icon.

create new file

Now after successful login we need to create the new file and provide the name as shown in the above screenshot.