Create Index html file in All newly created folder

See all posts Reply

Create Index html file in All newly created folder new!
by Nithin, 11 years, 10 months ago
Hello Team,

First of all thanks for your great script.

I have little suggestion to add index.html file in all newly created folders.

Right now, i modified _mkdir function to copy the index.html to all newly created folder.

$index_file = 'index.html';
copy($index_file, $path.'/index.html');



Thanks
NithinReply
Re: Create Index html file in All newly created folder new!
by colin, 11 years, 10 months ago
I think it is a little bit overkill, and should be dealt with the server configuration rather than the classReply
Re: Create Index html file in All newly created folder new!
by Bob Brown, 11 years, 10 months ago
I agree - your server configuration should be used to deny access to directory listings if that is your intention.

I can't speak for other web servers but in Apache you can do this (normally) by placing the following line in a .htaccess file in your web root:

Options -Indexes

Note that your webserver configuration MAY be set to ignore this in which case contact your webserver administrator. Chances are that on a shared hosting environment that this will work fine though.

See http://www.thesitewizard.com/apache/prevent-directory-listing-htaccess.shtml for example.Reply