Jump to content


How can I sort my Apache Directory Listing w/no index.html

  • Please log in to reply
2 replies to this topic

#1 rvacs

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 02 June 2003 - 12:51 PM

Hello All,

Sorry I have almost no knowledge of Apache but had a question. If your url has no index.html in that directory it shows a listing of files in that directory - GREAT - this is what I want.


Are there any scripts or values that allows me the ability to sort the file listing? Basically I would like to alphabetize or sort by type.
Any suggestions of what I should look at???

Thanks SO MUCH,

#2 holiks

  • Members
  • PipPipPip
  • Advanced Member
  • 83 posts

Posted 03 June 2003 - 11:24 AM

u can already sort ....by Name, Last Modified, Size and even Description...with apache ;D
__________________________________________________________[br]$php = array('..a stack', '...once you pop', '...you don't stop');

#3 Nevets

  • Members
  • PipPip
  • Member
  • 10 posts

Posted 12 June 2003 - 01:42 AM

From... http://httpd.apache...._autoindex.html

Autoindex Request Query Arguments
The column sorting headers themselves are self-referencing hyperlinks that add the sort query options to reorder the directory listing. The query options are of the form X=Y, where X is one of N (file Name), M (file last Modified date), S (file Size, or D (file Description), and Y is one of A (Ascending) or D (Descending).

When options other than the file name are used as the sorting key, the secondary key is always the file name. (When the file name is used to sort by, there is no need of a secondary sort key, since file names are guaranteed to be unique, and so the sort order is unambiguous.)


If the URL http://your.server.name/foo/ produces a directory index, then the following URLs will produce different sort orders:

http://your.server.name/foo/?M=D sorts the directory by last modified date, descending.
http://your.server.name/foo/?D=A sorts the directory by file description, ascending.
http://your.server.name/foo/?S=A sorts the directory by file size, ascending.
See IndexOrderDefault to set the default directory ordering.

Note also that when the directory listing is ordered in one direction (ascending or descending) by a particular column, the link at the top of that column then reverses, to allow sorting in the opposite direction by that same column.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users