Options +FollowSymlinks RewriteEngine On # if dir requested without trailing slash, # rewrite to dList which redirects to the # dir with the trailing slash added. RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_URI} !/$ RewriteCond %{REQUEST_URI} ^(.+)$ [OR] RewriteRule !^(.*)/$ /dlist/view.php?shit # rewrite to dList if no index files found RewriteCond %{REQUEST_FILENAME}/index.html !-f [NC] RewriteCond %{REQUEST_FILENAME}/index.php !-f [NC] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.*)$ /dlist/view.php