.htaccess (must contain dot at the beginning) is a file, which you can put into your site and by this file, you can edit the configuration and behavior of your site.
If you place this file in the directory www at your website, rules will be applied to the entire web. Alternatively, you can place it in a subdirectory, then the rules will be applied only to this directory, all its subdirectories, and files.
By using .htaccess is possible to do:
- setting of error pages (for example what to display when non-existent page)
- redirection
- restrict access to the website or its parts by IP addresses of visitors
- access password protection to the directory or file
- modul mod_rewrite – rewriting of URLs (the so-called. “pretty” or friendly URL)
- create a subdomains
In the webserver configuration are allowed the following categories of commands for htaccess:
- AuthConfig
- FileInfo
- Limit
- Indexes
In the files .htaccess on webhosting is not allowed to use:
- php_flag
- php_value
- ServerSignature
- SetHandler
- XBitHack
- AddHandler
Also for command Options is possible to use only one parameter Indexes, others are not allowed.
CAUTION! Using any disallowed command or forbidden parameter for Options command causes fault of the whole site, which will result in error 500 – Internal Server Error.