Forum Moderators: phranque
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ [%{HTTP_HOST}...] [R=301,L] but, sadly, I can only make this work in the root directory. To the subdirectories' index files the code does nothing at all. Any help?
(I am using that HTTP_HOST because there are two domains controlled by my .htaccess. Maybe this piece of code simply will not work in such a set up?)
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ http://%{HTTP_HOST}/$1 [R=301,L]
Try to avoid the use of the ".*" pattern. It is "easy" to use, but can be grossly inefficient, especially when it occurs more than once in a pattern.
Jim
[edited by: jdMorgan at 6:17 pm (utc) on Jan. 7, 2007]