Feature #2818

Custom HEADER and README filepaths in mod_dirlisting are treated as relative paths instead of absolute paths when file name starts with "/"

Added by abreemen over 2 years ago. Updated over 2 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Missing in 1.5.x:



We use mod_dirlisting to list the contents of a connected USB drive. The document root in lighttpd.conf is set to "/www/usb" wich is the mounting location for the USB drive. To style the dirlisting page we use a custom HEADER.txt and README.txt. These files currently have to be placed on the root of the USB Storage and in each subdirectory.

We are currently designing a solution where anyone could place files and directories on the USB Storage. Therefore we want to deliver HEADER.txt and README.txt from an external directory, not placed on the USB Storage. Since 1.4.43 lighttpd supports custom file names for HEADER and README, but the file path is still relative to the current (listed) directory. The goal is to serve these HEADER/README files from a directory in the internal storage, rather than the current listed directory.

Without a patch for mod_dirlisting I need to use a relative path like "../../../../../../../../www/HEADER.txt" for the header file to ensure it's working for at least 7 levels deep. When you enter the 8th subfolder, lighttpd can't find the file anymore.

When the custom or setting starts with an "/", treat it as an absolute path. When it doesn't, append the value to the current directory (current behaviour).
After applying this patch lighttpd built succesfully and the HEADER.txt and README.txt are working for infinite subfolders.



Updated by gstrauss over 2 years ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.46

Updated by gstrauss over 2 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom