There is a problem in setting htaccess auth for subdirectories if the main folder contains another htaccess file (especially in cart sites). In this case we will get 404 not found error message even if the sub-folder is existing.
To resolve this .htaccess rule conflict, you can override the default error document path by adding the “ErrorDocument” directive in the .htaccess file. Just put the below line on the top of the main htaccess file.
ErrorDocument 401 default