1

I have a Download folder where I set up a directory listing sorted by last modified date, like this :

<Directory /var/www/html/Downloads/>
            Options +Indexes
            IndexOrderDefault Descending Date
</Directory>

I want to keep this folder sorted by date, but have all its sub-directories (recursively) sorted by name. Is it possible ?

I tried this and it didn't work :

<Directory /var/www/html/Downloads/>
            Options +Indexes
            IndexOrderDefault Descending Date
</Directory>
<Directory /home/Download/*/*>
            IndexOrderDefault Ascending Name
</Directory>

Thanks a lot

1 Answer 1

1

It's not clear whether you mean the folder /var/www/html/Downloads/ and all subfolders of /home/Download/ OR the folder /var/www/html/Downloads/ and all its subfolders.

/var/www/html/Downloads/ and all its subfolders:

<Directory /var/www/html/Downloads/>
            Options +Indexes
            IndexOrderDefault Descending Date
</Directory>

<DirectoryMatch "^/var/www/html/Downloads/(.+)/">
            Options +Indexes
            IndexOrderDefault Ascending Name
</DirectoryMatch>

If there is no misspelling in /home/Download/, try:

<Directory /home/Download/*/>
            Options +Indexes
            IndexOrderDefault Ascending Name
</Directory>
1
  • Thanks for your help. I solved my problem by using JS on the listing page to add "?C=N;O=A" at the end of all the links.
    – Jean D
    May 12, 2018 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .