Don’t Allow the End User to Modify the Listing
Problem
You don’t want the end user to be able to modify the output of the directory listing.
Solution
Place the following IndexOptions directive in the <Directory> scope where you wish this restriction to be in place:
IndexOptions +IgnoreClient
Discussion
Although it is generably preferable to allow the end user to have some control over her user experience, there may be times when you wish for a particular directory listing to be presented in a particular way, without the option of a user to modify that display.
Although most users will probably be unaware of the ability to do so, by default any user can modify the output of the directory listing with a combination of QUERY_STRING arguments. With the recipe shown above, this feature is disabled.
When IgnoreClient is set, SuppressColumnSorting is also put into effect. That is, the clickable header at the top of each column is removed so that the user isn’t misled into thinking that he can alter the sort order by these links.
IgnoreClient can be used in conjunction with IndexOrderDefault to enforce a certain nondefault directory listing order.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access