I have a site with multiple different sites in sub-directories. I want to view the sub directory in two formats.  For example:www.example.com/blogwww.example.com/blog/Both should show the index page under blog folder.After turning DirectorySlash off, redirection is off from www.example.com/blog to www.example.com/blog/ but in www.example.com/blog, all contents of that folder are showing instead of the index file.
Removing trailing slash for sub directory url indexing
web hosting
I think I understand what you want better now.   Let me recap:/test should show the contents of /test/index.html/test/ should redirect to /test/test/index.html should redirect to /test/test/something.html should show its own contentsYou can do this with the knowledge that I gained by asking about how to do something similar here: How to rewrite to a script and also redirect away from that script using .htaccess while avoiding infinite loopsThis is what you can put in .htaccess that should work for you:DirectorySlash OffRewriteEngine onRewriteRule ^test$ /test/index.html [L,E=LOOP:1]RewriteCond %{ENV:REDIRECT_LOOP} !1RewriteRule ^test/$ /test [R=301,L]RewriteCond %{ENV:REDIRECT_LOOP} !1RewriteRule ^test/index.html$ /test [R=301,L]I tested this on my server, it satisfies all the conditions that I outlined above when I have a /test/ directory containing the files index.html and something.html