HTAccess redirect directories to index.html

Posted by BFTrick on Pro Webmasters See other posts from Pro Webmasters or by BFTrick
Published on 2011-01-07T17:55:45Z Indexed on 2011/01/07 17:59 UTC
Read the original article Hit count: 213

Filed under:
|

Hi there,

I am working on a site that where I do not have permission to the server and someone else keeps changing the settings. That person just changed the settings preventing users from going to example.com/foo/ and seeing the index page.

This Virtual Directory does not allow contents to be listed.

If you type in example.com/foo/index.html you can still see the file.

So I want to use htaccess to redirect all urls that end in a directory to change into directory/index.html How do I write that?

I started with some code that changes .php files to .html files and tried to work from that but I couldn't quite get it to work.

RewriteRule ^(.*)\.php$ /$1.html [R=301,L]

Any suggestions?

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about directory