Welcome to WebmasterWorld Guest from 54.146.217.179

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

preventing index of root dir/foo/bar

preventing index of root_dir/foo/bar

     
7:36 am on Mar 6, 2010 (gmt 0)

New User

5+ Year Member

joined:Feb 14, 2010
posts:34
votes: 0


Welcome friends,

i got stuck in a problem, thought your help would fix it out

i want to prevent displaying the directory content which does not contain any "index.html", index.php index.wml etc... so what i want to do do is prevent displaying these content like "index of root_dir/foo/bar"

so hows thins possible?

Your help is greatly appreciated,
Thanks

Rajendra
7:40 am on Mar 6, 2010 (gmt 0)

New User

5+ Year Member

joined:Feb 14, 2010
posts:34
votes: 0


oh i forgot, i use linux, apace(SpeedLite), php as configuration
Thanks
8:21 am on Mar 6, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


If I remember rightly, put this in your .htaccess file:

Options -Indexes


Don't forget to also set:

DirectoryIndex index.html index.php


or whatever you do need.
8:28 am on Mar 6, 2010 (gmt 0)

New User

5+ Year Member

joined:Feb 14, 2010
posts:34
votes: 0


ok i will try it now...

Thanks, but can u explain what
"Options -Indexes" does?


and "DirectoryIndex index.html index.php" is not for displaying index.php and index.html file as default....

but if i dont have default index.php then how to prevent them?

Thanks for your help

- Rajenrda Pondel
8:36 am on Mar 6, 2010 (gmt 0)

New User

5+ Year Member

joined:Feb 14, 2010
posts:34
votes: 0


Thank you very much g1smd, "Options -Indexes" does what i want, thank you.

- Rajendra Pondel