Example: blocking access to some files.


Sometimes there is a need to deny access to certain files. For example, to configuration files containing access details to databases, interfaces and etc. For example, in the file config.cfg you store the login/password for accessing the database. Create a file in this directory .htaccess with directives:



Order allow,deny
Deny from all

Now, if a visitor types something like in the browserhttp://www.ваш_домен.ru//config.cfg , it will get a 403 error or your page for this error.