Welcome to WebmasterWorld Guest from 188.8.131.52
Some bots try to access foo.com/index.html but there is now such file. There is only one foo.com/index.php which is the startpage.
But I have hundrets of index.html files in subdirs like foo.com/abc/index.html
I don't know how to handle it graceful via htaccess :(
RedirectMatch 301 ^/index.html$ http://www.foo.com/index.php
Specifying a 301-Moved Permanently redirect status will tell search engines to update the URL in their index. This will prevent problems with your search engine listings.
The RedirectMatch directive is not processed by mod_rewrite, but rather by mod_alias.
Is it somehow possible to have the "DirectoryIndex" only for the frontpage?
www.foo.com/index.php <- DirectoryIndex
www.goo.com/2/34/567/index.html <- DirectoryIndex
There are around 500 subdirs and a htacess for all of them is a pain in the .. brain ;)
In your case case, I'd recommend you just set DirectoryIndex to index.html, and then use mod_rewrite to internally rewrite index.html to index.php in the root directory only. That would avoid having to put an .htaccess file in each subdirectory of root.
This problem is much easier to solve if you have access to httpd.conf... :(