Hello friends! I see that this topic has not yet been covered in Russian. version of this resource in this format, so please connect to the issue. Required by the basic out method. protect the directory on the server, or, if possible, a specific file. As I understand it all comes down to the fact that you need to register some settings in. Htaccess. Who can help with a ready-made solution (code).

I have generated a couple login password, which I inserted into the file. In .httaccess, which lies in the root of the file, I registered the following code:

AuthName "Login" AuthUserFile /home/admin/web/mydomain.com/public_html/terminals/.htpasswd AuthGroupFile /home/admin/web/mydomain.com/public_html/terminals AuthType Basic <LIMIT GET POST> require valid-user </LIMIT> 

But as a result, I get an authorization request on all pages of the site, and not in a specific directory. Please help edit code

  • Perhaps you can help edit my code to get the desired result? - WhoIsDT
  • Well, put this .httaccess file in the directory you need to close - Ipatiev
  • As an option, you are right, I thought you could simply prescribe some settings for a file that is rooted in a specific directory - WhoIsDT
  • it is possible and central, but the very essence of the .htaccess file is that it is a per-directory configuration file. that is, the most logical would be simply put in the directory. But if you want to manage from the main, then you can use the directive <Directory>. For a specific file, you can specify <files> - Ipatiev

0