January 31st, 2012, 07:31 AM
Setting Descriptions on Directories for AutoIndex
I am using an index listing via apache to stream my music and videos to a Roku device. I have a script that sets up the index directory structure and I want to use descriptions in .htaccess to sort the directories alphbetically. That way I can remove words like "the" in the description without actually renaming the directory and have it sorted correctly. I can use mod_autoindex directive of AddDescription easily enough, but that matches too broadly and I can't seem to get to match one directory without matching others.
For example, I am trying to use it sort my music by artist so I add descriptions in an .htaccess for all of the artists, like
The first statement matches Queen, Queensryche, etc and the second gets ignored since the first one partially matches the directory name. I have tried using <Directory>, <DirectoryMatch>, <Location>, and <LocationMatch> but I am apparently doing something wrong as these seem to break my .htaccess completely.
IndexOrderDefault Ascending Description
AddDescription "Queen" "*/Queen"
AddDescription "Queensryche" "*/Queensryche"
January 31st, 2012, 04:03 PM
I didn't find the answer to this question, but I scripted around the problem by moving the more restrictive match higher in the list. There were only a few that caused an issue it not that big of a deal. That made this work, but I would still be interestd to know if you can restrict AddDescription to single directory name.