You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by André Warnier <aw...@ice-sa.com> on 2008/09/30 11:34:07 UTC

[users@httpd] question on DirectoryIndex "inheritance"

Hi.

Apache 2.2.x, any platform

Suppose I have this configuration snippet :

<Directory /var/www/site/topdir>
   Options Indexes
   DirectoryIndex index.html welcome.html index.php whatever.html
...
</Directory>
<Directory /var/www/site/topdir/subdir>
   Options ?????
   DirectoryIndex ??????
</Directory>

How do I specify that the list of index documents provided in the 
"topdir" is no longer valid in "subdir", and that I would like Apache to 
just return its standard self-generated list of files ?

- if in subdir, I specify neither Options nor DirectoryIndex, then these 
options are inherited from topdir, which is not what I want.
- if I put in subdir "Options -Indexes", then the list of index 
documents is still inherited from topdir; Apache looks for all of them 
in sequence, and if neither of these documents is present in subdir 
(which is the case), Apache returns "forbidden", which is also not what 
I want
- if I put no "Options", but I put a "DirectoryIndex 
SomeOtherFile.html", then at each access to "subdir", Apache still looks 
for "SomeOtherFile.html", and if it does not find it (which is the 
case), generates the index itself.  Which is essentially what I want, 
but I find the useless lookup for "SomeOtherFile.html", well, useless..

What I would like is leaving topdir as it is, but in "subdir" stopping 
Apache even looking for an index document (since there is none), and 
immediately return the list of files.
Is there a way to do that ?
(I did not see a "DirectoryIndex none" as a possibility in the doc)

Thanks in advance

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] question on DirectoryIndex "inheritance"

Posted by Justin Pasher <ju...@newmediagateway.com>.
André Warnier wrote:
> Hi.
>
> Apache 2.2.x, any platform
>
> Suppose I have this configuration snippet :
>
> <Directory /var/www/site/topdir>
>   Options Indexes
>   DirectoryIndex index.html welcome.html index.php whatever.html
> ...
> </Directory>
> <Directory /var/www/site/topdir/subdir>
>   Options ?????
>   DirectoryIndex ??????
> </Directory>
>
> How do I specify that the list of index documents provided in the 
> "topdir" is no longer valid in "subdir", and that I would like Apache 
> to just return its standard self-generated list of files ?
>
> - if in subdir, I specify neither Options nor DirectoryIndex, then 
> these options are inherited from topdir, which is not what I want.
> - if I put in subdir "Options -Indexes", then the list of index 
> documents is still inherited from topdir; Apache looks for all of them 
> in sequence, and if neither of these documents is present in subdir 
> (which is the case), Apache returns "forbidden", which is also not 
> what I want
> - if I put no "Options", but I put a "DirectoryIndex 
> SomeOtherFile.html", then at each access to "subdir", Apache still 
> looks for "SomeOtherFile.html", and if it does not find it (which is 
> the case), generates the index itself.  Which is essentially what I 
> want, but I find the useless lookup for "SomeOtherFile.html", well, 
> useless..
>
> What I would like is leaving topdir as it is, but in "subdir" stopping 
> Apache even looking for an index document (since there is none), and 
> immediately return the list of files.
> Is there a way to do that ?
> (I did not see a "DirectoryIndex none" as a possibility in the doc)
>
> Thanks in advance

I am not finding a way in the documentation to "disable" a 
DirectoryIndex that is already defined, so you might be stuck with the 
hack you have above. Off the top of my head, I can't think of any other 
creative ways to accomplish this.

-- 
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org