Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www.domen.ru$ [NC]
RewriteRule ^(.*)$ https://domen.ru/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^(.*)/index\.(php|html|htm)\ HTTP/
RewriteRule ^(.*)index\.(php|html|htm)$ https://domen.ru/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} robots.txt
RewriteCond %{DOCUMENT_ROOT}/robots.php -f
RewriteRule ^(.*)$ /robots.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ https://%{HTTP_HOST}/$1/ [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ https://%{HTTP_HOST}/$1/ [L,R=301]
!-f
нужна проверка что это существующая папка -d
.RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*[^/])$ https://site.ru/$1/ [R=301,L]