DirectorySlash Off RewriteEngine On RewriteCond %{REQUEST_URI} !^/$ RewriteCond %{REQUEST_URI} .+/$ RewriteRule ^(.+?)/$ /$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}/index.php -f RewriteRule ^(.+)$ $1/index.php [L] RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}/index.html -f RewriteRule ^(.+)$ $1/index.html [L]