I'm looking for an ".htaccess" file solution to rewrite requested addresses ending in both "./index.html" and "./index" down to only the site root or subfolders, such as "http://www.mydomain.com/index[.html]" down to only "http://www.mydomain.com/". I've found some help with the "index.html" issue, but I'm having a hard time making the solution work for the "./index"-only request. I'm using the following code with my attempt at the "./index"-only piece commented out:
# MOD_REWRITE IN USE
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# Redirect "index" page requests to either root or directory
# These first two lines work for "./index.html"...
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://%{HTTP_HOST}/ [R=301,L]
## These three lines don't work, last two are alternates of one another...
## RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index*\ HTTP/
## RewriteRule ^index*$ http://%{HTTP_HOST}/ [R=302,L]
## RewriteRule ^index*$ $1 [R=302,L]
# Hide .html extension - additional information
# To externally redirect /dir/foo.html to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R=301,L]
# To internally forward /dir/foo to /dir/foo.html
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*?)/?$ $1.html [L]
(The latter portion is for hiding the ".html" endings, as noted, and may superfluous, but I included the whole script, as is.) I don't know the version of Apache server, but any assistance would be greatly appreciated. Thanks.