Or, if you don't have access to the main httpd.conf file, just put a
DirectoryIndex line in a .htaccess file in your root folder that lists all
possible indexes, followed by your default front page:

DirectoryIndex index.html index.shtml index.htm index.php index.php3
/index.php

So, if non of the first 5 file names are found in the directory, Apache will
redirect to your front page (assumption is your frontpage is called
index.php, if it's not, change the last value, but leave the /).

HTH,

Peter Janett

New Media One Web Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882



----- Original Message -----
From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]>
To: "conbud" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, November 22, 2002 3:48 PM
Subject: Re: [PHP] Linux and Apache


> At 23:11 22.11.2002, conbud said:
> --------------------[snip]--------------------
> >Hi. I spent the last 3 days looking through the apache docs to figure out
> >how to disable directory listing. I can disable the directory listing to
my
> >images folder but then all the images on the site dont work. I tried
using
> >Allow from mydomain
> >and
> >Allow from localhost
> >Allow from 127.0.0.1
> --------------------[snip]--------------------
>
> "Allow" specifies who can _read_ the folder and has nothing to do with
> sending a directory listing or not.
>
>  From the Apache FAQ, paragraph 19:
>     http://httpd.apache.org/docs/misc/FAQ-E.html#indexes
>
> --------------------[quote]--------------------
> How do I turn automatic directory listings on or off?
> If a client requests a URL that designates a directory and the directory
> does not contain a filename that matches the DirectoryIndex directive,
then
> mod_autoindex can be configured to present a listing of the directory
contents.
> To turn on automatic directory indexing, find the Options directive that
> applies to the directory and add the Indexes keyword. For example:
> <Directory /path/to/directory>
>     Options +Indexes
> </Directory>
> To turn off automatic directory indexing, remove the Indexes keyword from
> the appropriate Options line. To turn off directory listing for a
> particular subdirectory, you can use Options -Indexes. For example:
> <Directory /path/to/directory>
>     Options -Indexes
> </Directory>
> --------------------[/quote]--------------------
>
> To disable indexing completely, simply omit the "Indexes" option on the
> document root directory.
>
> What happens if e.g. the /images/ directory is accessed, a "Forbidden"
> response is sent:
>
> ---------------------------------
> Forbidden
> You don't have permission to access /images/ on this server.
> ---------------------------------
>
>
> --
>    >O     Ernest E. Vogelsinger
>    (\)    ICQ #13394035
>     ^     http://www.vogelsinger.at/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to