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, etc. For example, in the config.cfg file 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 browser http://www.ваш_домен.ru//config.cfg , he will get a 403 error or your page for this error.