Bug 24243 - mod_autoindex enhancement ('IndexIgnoreRemove' option)
Summary: mod_autoindex enhancement ('IndexIgnoreRemove' option)
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_autoindex (show other bugs)
Version: 2.0.47
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2003-10-30 09:19 UTC by Rafael Faura
Modified: 2015-02-03 07:21 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Faura 2003-10-30 09:19:59 UTC
I'm going to put here the summary of a very recent Apache users mailing list 
discussion about mod_autoindex between Robert Andersson and me, Rafael Faura:

1) [Rafael Faura] --> I'm using Apache 2.0.47 with Windows 2003 Standard 
Edition. Before posting to this mailing list i've readed Apache docs 2.1 
(http://httpd.apache.org/docs-2.1/) and searched Google for possible answers 
but without luck. My question is related with dynamic listings that Apache show 
when somebody access to a directory that doesn't have an 'index' file. I have 
the next folder structure:

|_ Updates
   |_ Old

I want that 'Updates' and 'Old' listings have a 'Parent Directory' link on
top (as usual) but i don't want that 'CAE' listing show that 'Parent
Directory' link. I've tried several configurations with 'IndexIgnore ..'
option into 'CAE', 'Updates' and 'Old' directives but without luck. I'm out
of ideas...

2) [Robert Andersson] --> It seems you're out of luck. You can disable the 
parent entry by using "IndexIgnore ..", but as far as I can see, there is no 
way "unignore" it.

mod_autoindex is intentionally not very flexible, because what it does is soo 
simple. If you really don't want the parent entry in the listing, you can make 
a Perl or PHP script rather quick, that behaves and look exactly like you want.

3) [Rafael Faura] --> Well, seems like I should learn some PHP and Perl to make 
such script, anyway thanks for your reply. Maybe a little suggestion for future 
Apache/mod_autoindex versions: allow to put 'Parent Directory' link per 
directory instead how is done now (parent entry always appears).

4) [Robert Andersson] --> The problem is not specific to the "parent directory" 
entry, but general in that (it seems) one cannot remove entries previously 
added to the IndexIgnore list higher up in the directory tree. There should 
perhaps be an "IndexIgnoreRemove" directive, in which case you could do:

    <Directory /path/to/docroot/CAE>
        Options +Indexes
        IndexIgnore ..
    <Directory /path/to/docroot/CAE/Updates>
        IndexIgnoreRemove ..


That´s all :)
Comment 1 Randy Weinstein 2004-06-27 02:09:02 UTC
Bug present in Apache httpd-1.3
IndexIgnore would be helpful in both versions
Comment 2 Dan Jacobson 2008-04-08 16:26:50 UTC
Dear Apache. I am but a lowly .htaccess user.

The good people at my hosting company have made dot files invisible.

This is great in general, however as I am a Unix expert, I wish to
share some of my dot files via my website, however there is no way,
thanks to the poor design of your agglutinative IndexIgnore.

Yes, even with the best wishes of my hosting company, there is no way
of me turning dot files back on without them having to embed a special
case for my directory in their configuration.

Therefore, you need two levels:
IndexIgnore and IndexIgnoreManditory,
or IndexIgnoreFlexible and IndexIgnore.

OK, as of course you will not give in to my demands, please still in
apache2-doc/manual/en/mod/mod_autoindex.html#indexignore document that
there is no way to reset or remove items from IndexIgnore. Without you
mentioning that there is no way, users will go on wild goose chases

>>>>> "DH" == DreamHost Sales Team <sales@dreamhost.com> writes:

DH> Hello,

DH> I am sorry but I am unaware of a way to display the hidden files (i.e.:
DH> .emacs) through your browser.  I've tried a Google search to see if this
DH> is possible but my search was inconclusive.

DH> On Mon, 07 Apr 2008, you wrote:

>> Looking at http://wiki.dreamhost.com/Modifying_directory_indexes
>> and wanting these
>> $ ls -ogA ./jidanni.org/comp/configuration/
>> -rw-r--r-- 1 14806 2008-04-08 06:24 .emacs
>> -rw-r--r-- 1 17637 2008-03-26 12:22 .gnus.el
>> -rw-r--r-- 1   746 2007-11-19 23:50 .muttrc
>> to show up in
>> $ w3m -dump http://jidanni.org/comp/configuration/
>> Is there nothing at all I can do, even with
>> $ cat ./jidanni.org/comp/configuration/.htaccess
>> IndexIgnore .htaccess
>> due to http://httpd.apache.org/docs/1.3/mod/mod_autoindex.html#indexignore
>> being additive with no way to reset IndexIgnore (to just .htaccess but
>> no dot files), and I should file a bug with apache.org?
Comment 3 svobomic 2010-04-20 06:56:43 UTC
(In reply to comment #0)
> mod_autoindex is intentionally not very flexible, because what it does is soo 
> simple. If you really don't want the parent entry in the listing, you can make 
> a Perl or PHP script rather quick, that behaves and look exactly like you want.

I just want to note that this is utter nonsense, as developing and testing such a script is going to take the good portion of the day, if not two. Off the head, I can imagine you'll have to make sure people can't wander outside confined space, either by '..' or by symlinks, embedding nulls etc etc.

In other words mod_autoindex is not as simple as it seems, there already is quite some functionality and throwing it away is not as easy as described.
Comment 4 Christophe JAILLET 2015-02-03 07:21:47 UTC
Directive IndexIgnoreReset has been added in the 2.4.x branch (in the 2.3.10 dev release)