3

I was very surprised that I couldn't find this answer on Google.

I have seen someone access the default Apache index page (no index.html present, so it just shows the directory listing) with query string parameters. The URL they used was similar to:

http://example.com/?C=M;O=D 

It looks like O=D means "order = descending," since it reversed the order of the list, but I want to know what other parameters can be passed in, and what they mean. Is this documented somewhere? I couldn't find it.

2 Answers 2

5

From http://www.gforums.net

"C=M;O=D" is the query string passed in to the URLs that are browseable. It's used to sort the files list.

O is the sort order, which can either be A or D for ascending and descending respectively.

C is for column name which is to be sorted. It can take the following values:

N - Name (file name) column

M - Last Modified column

S - Size column

D - might be for Description

You might want to have a look at this : https://httpd.apache.org/docs/2.2/mod/mod_autoindex.html

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. The Apache docs page explains it completely. Not sure how I didn't find that in my searches.
1

Just to add to the excellent accepted answer, if you want to change the default fancyindex file listing order, use the IndexOrderDefault directive.

For example:

Options +Indexes IndexOrderDefault Descending Date 

1 Comment

Please don't answer off-topic questions - vote to close them instead. Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.