How to correctly insert the last slash by means of .htaccess?
It is necessary that the last slash is inserted in the address bar. It is necessary that this would work with "virtual folders". It is necessary that it be multi-domain. (two domain names) It is necessary that this would not cause other problems.
UPD: Error like: example.com/cgi-bin/401.cgi/ , pop-up and other similar errors redirecting to the file '/cgi-bin/*.cgi' means that there are not enough ErrorDocuments in the server settings. Those. in my case, it was necessary to register in .htaccess: ErrorDocument 401 "Access Denied" or ErrorDocument 401 /path_to_401_error_file.html