It is necessary to close access to the entire site using htpasswd, but so that it remains open to a single URL, for example site.com/mj
Found a way:
SetEnvIf Request_URI "/mj" noauth=1 RewriteEngine on RewriteRule ^(.*) public/$1 [L] AuthType Basic AuthName "Private zone. Only for administrator!" AuthUserFile .../.htpasswd Require valid-user # Here is where we allow/deny Order Deny,Allow Satisfy any Deny from all Require valid-user Allow from env=noauth