<IfModule mod_rewrite.c>
    DirectorySlash Off 
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME}\.html -f
    RewriteRule ^(.*)  /$1.html [L] 
    RewriteCond %{REQUEST_FILENAME}\.php -f 
    RewriteRule ^(.*)  /$1.php [L]
    RewriteCond %{THE_REQUEST} \s/+(.*?/)?(?:index)?(.*?)\.(html|php)[\s?/] [NC] 
    RewriteRule ^(.*)  /%1%2 [R=302,L]
    RewriteCond %{REQUEST_URI} !(/$|\.) [NC]
    RewriteRule ^  %{REQUEST_URI}/ [R=302,L] 
</IfModule>