homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

preventing index of root dir/foo/bar
preventing index of root_dir/foo/bar

Msg#: 4092544 posted 7:36 am on Mar 6, 2010 (gmt 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,




Msg#: 4092544 posted 7:40 am on Mar 6, 2010 (gmt 0)

oh i forgot, i use linux, apace(SpeedLite), php as configuration


WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4092544 posted 8:21 am on Mar 6, 2010 (gmt 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.


Msg#: 4092544 posted 8:28 am on Mar 6, 2010 (gmt 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


Msg#: 4092544 posted 8:36 am on Mar 6, 2010 (gmt 0)

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

- Rajendra Pondel

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved