mod_rewrite: Redirect all index files to /

Using .htaccess I want to redirect all requests from index files to the directory index.

Anything that starts with “index.” should be redirected to that directory index, including all sub directories.

http://example.com/index.html
Should redirect to:
http://example.com/

http://example.com/sub/dir/index.php
Should redirect to:
http://example.com/sub/dir/

http://example.com/images/large/index.htm
Should redirect to:
http://example.com/images/large/

h,

What do you want Apache to serve?

Yeah, yeah, DirectoryIndex will take care of that but some servers are setup to change from / to the DirectoryIndex with a 301 code. Loopy? Check that first.

Then, because we don’t code for “Script Kiddies,” PLEASE show what you’ve tried and we’ll help you get through this.

BTW, IMHO, what you’re trying to do is not a good idea.

Regards,

DK