Page 1 of 1

How do i disable or enable directory browsing?

Posted: Tue Jul 26, 2005 10:48 pm
by gnel2000
Hi all,
i have a problem here. I try to disable a directory browsing features at one of my directory with .htaccess.
I have gone thru many article which teach to at this line "Options +Indexes" in the .htaccess and place it in the directory i would like to disable the directory browsing.
But the problem is, i tried this method many time but still cannot get it done.
Is it what i did is wrong? Any idea?

p/s: i dont have the control of the apache configuration file.

Posted: Tue Jul 26, 2005 11:23 pm
by theda
If you only want to keep people from viewing a list of contents in a directory, you can easily just put an index.php/.html in there and anytime someone tries to view the directory list, it'll just load the index page. If you don't want them to view anything in that directory, you should be able to add a username/password to a .htaccess file, other than that, you're a tad bit out of luck unless you like a ton of work ^_^;

Posted: Wed Jul 27, 2005 12:00 am
by gnel2000
i was suggested that to the management, but they felt is very trouble to add an index file in every directory. anyway, thank for the info.

but i still wondering how the .htaccess work with only one line : Options Indexes?

Posted: Wed Jul 27, 2005 8:26 am
by timvw
You need to make sure you are allowed to override the settings in a .htacess file...

For example the following in httpd.conf gives the user to use .htaccess freely

Code: Select all

<VirtualHost *:80>
  ServerName localhost
  DocumentRoot &quote;F:/websites/localhost&quote;
  <Directory &quote;F:/websites/localhost&quote;>
    AllowOverride All
    Options All
  </Directory>
</Virtualhost>