Jump to content

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


rvacs

Recommended Posts

:D

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.

 

BUT

 

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,

Rich

Link to comment
Share on other sites

  • 2 weeks later...

From... http://httpd.apache.org/docs/mod/mod_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.)

 

Example:

 

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.