Directory Listing - is ascending possible as default?

when I have a directory on my hosting without an index file I get a directory listing ( thats good )

but I find it defaults to descending ?C=N;O=D so the file names are in reverse order starting with Z going through to A

is it possible to set the default to ascending ?C=N;O=A so that the file names start at A going through to Z ?

thanks

Whut?

you can use the .htaccess file
preferably only in the desired directory and for the rest disabled it for security reasons

# SET INDEX OPTIONS
IndexOptions FancyIndexing
IndexOrderDefault Descending Date

and you adjust according to your wishes (Descending vs Ascending)
you need Name instead of Date (in my example above)

Name, Date, etc. mod_autoindex - Apache HTTP Server Version 2.4

if you already have some dir listing opened with a browser
and you are trying to test the .htaccess rules at the same time
know that refresh button doesn’t help you…
the change is visible if you enter some subdir in the dir listing and return to the parent
(at least that’s how my FF behaves but of course if you come right away without testing window then of course it works right away)

5 Likes

that did the job, thanks

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.