What is a htaccess file?

A .htaccess file allow you to make configuration changes on a per-directory basis. htaccess file works on both Linux/Unix and Windows operating systems.

An htaccess file is a simple ascii text file which you create or edit in a text editor. The dot (.) before the word htaccess indicates that .htaccess is a file extension

The .htaccess file usually resides in the root public_html directory of your server. When placed in the root public_html directory, the .htaccess file contents affect every file in your public directory, including every file in every sub directory. For example public_html/.htaccess would affect files in public_html as well as files in public_html/files/ and public_html/files/morefiles. You can override the effects of the root public_html .htaccess file in a subdirectory by placing another .htaccess file in that subdirectory.

A number of different uses are seen below:

Error Documents
Password protection
Enabling SSI via htaccess
Blocking users by IP
Blocking users/ sites by referrer
Blocking bad bots and site rippers (aka offline browsers)
Change your default directory page
Prevent viewing of htaccess
Adding MIME types
Preventing hot linking of your images and other file types
Preventing directory listing

Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read

Powered by WHMCompleteSolution


Web Request

  • © 2006 -
  • All Rights Reserved.
  • Legal / Privacy