MartyMacGyver
MartyMacGyver

Reputation: 10093

Apache: How can I sort a directory listing numerically?

I've got a website with a large directory tree. At some levels there are numerically-named directories, such as 123,45, 67,8 and 67,21. I'd like to sort these such that 123,45 comes after 67,*. Ideally, 67,8 would come before 67,21 as well:

67,8
67,21
123,45

(Note: ',' could as easily be '.', '-', etc.)

Is there a simple way to accomplish this within Apache (either directly or by creating a small plugin for it), or am I going to have to turn the site into some kind of CGI-based thing to make it sort numerically?

Upvotes: 0

Views: 2114

Answers (1)

oldmonk
oldmonk

Reputation: 739

Just need add V=1 parameter, then directory will be displayed in version sorting mode.

example:

http://www.yoursite.com/?V=1

There are more detail information about parameters of apache autoindex module in http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#page-header.

Upvotes: 2

Related Questions