Click to See Complete Forum and Search --> : directory listings
macian
09-25-2002, 11:00 AM
I was wondering if it is possible to have only certain directory's list. Like for example in the httpd.conf file it sets it globally that access is forbiddin, which is how I want it. Is there a way to change with with, i dunno, like an .htaccess file to ignore the access forbiddin and do a directory listing.
Thanks in advance
Sean D.
macian
09-25-2002, 01:18 PM
also i am trying not to make any changes to the httpd.conf file
cause this will work
<Directory
/pathh/you/want/to/have/indexed>
Allow SymLinks Indexes
</Directory>
But every time i want a different directory to list i would have to restart apache.
Thanks
Sean D.
What you'd need to do is change your httpd.conf to allow .htaccess files control over indexing, which is done with the 'AllowOverride Indexes' option. I might suggest using the 'Limit' and 'Options' directives also, they can allow you to limit access to the directories by IP or host, and all the standard options available, respectively.
So for example, let's say you want to give specific control to users in their own home directories, you might use something like this:
<Directory /home/*/public_html>
AllowOverride Indexes Limit Options
Options -Indexes
</Directory>
By default, this configuration will deny indexing to all directories. Note I'm using the minus sign in front of -Indexes, which turns it off. If the user desires to index a particular directory, they simply create an .htaccess file with the following content:
## .htaccess
## ~username/somedir
Options +Indexes
## eof
All other directories will be dissallowed indexes but this one. The plus sign on +Indexes turns it back on. Please note that all subdirectories underneath this will also have indexing turned on.
Links:
htaccess tutorial (http://httpd.apache.org/docs/howto/htaccess.html)
AllowOverride format (http://httpd.apache.org/docs/mod/core.html#allowoverride)
macian
09-26-2002, 03:19 PM
our friggin standing... worked like a charm...
Thank You
Originally posted by macian
our friggin standing... worked like a charm...
Thank You
np, glad you got it working. :)