LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Stop directory listings in Apache (https://www.linuxquestions.org/questions/linux-software-2/stop-directory-listings-in-apache-184759/)

lothario 05-23-2004 05:48 AM

Stop directory listings in Apache
 
Hi,

I am new to Apache.
I have it up and running on Red Hat 9.
I have a bunch of web sites on this system.

How do I do this:

1. Prevent anyone from getting a directory listing
of any directories under "/var/www/html"

2. If any directory does not contain an "index.html"
file then my default "/var/www/html/nopage.html"
should be displayed instead.


Very often I change the contents of the
"/var/www/html/nopage.html" file so I
would like to maintain only one copy of this file.


Thanks.

trickykid 05-23-2004 08:57 AM

Got to love the docs over at apache.org.. http://httpd.apache.org/docs/mod/mod_autoindex.html

djadhav 05-23-2004 09:17 AM

you may put a index.php (or index.html) in the required deirectory which will redirect the user to some error page.

Apache site has this redirecting thing very well explained. I dont remember exactly where it is, 'cause I saw it as a tip while validating my web-site at validator.w3.org


All times are GMT -5. The time now is 06:26 PM.