I'm trying to add a description to the (apache generated) directory listing. However I can't figure out a way to get the description text to only be applied for an exact match of the file/directory name.
For example, if I have the following directory/file structure
AddDescription "PHP" phpinfo
You can do this:
AddDescription " " *?phpinfo AddDescription " " phpinfo?* AddDescription "PHP" phpinfo
Apache applies the first matched rule and skips any following rule. The trick here is to use
" ", which is the default content for a file/folder that doesn't match anything, to nullify any file/folder that contains
phpinfo but isn't exactly
phpinfo, so that only a file/folder exactly named
phpinfo gets the description applied.
Note that you cannot use
AddDescription "" ... because Apache does not allow an empty string parameter and will throw an error.
ref: Apache 2.4 doc