Skip to content

Instantly share code, notes, and snippets.

@nmicht
Last active Feb 17, 2019
Embed
What would you like to do?
Apache htaccess to list files with a beauty format
# ENABLE DIRECTORY
# Docs: https://httpd.apache.org/docs/2.4/mod/mod_autoindex.html
Options +Indexes
IndexOptions IgnoreCase FancyIndexing FoldersFirst HTMLTable NameWidth=* SuppressHTMLPreamble ScanHTMLTitles SuppressLastModified DescriptionWidth=*
# SPECIFY HEADER FILE
HeaderName /header.html
# SPECIFY FOOTER FILE
ReadmeName /footer.html
# IGNORE THESE FILES
IndexIgnore .htaccess header.html footer.html main.css favicon.ico cgi-bin
# DESCRIPTIONS
AddDescription "Adobe Portable Document Format" .pdf
AddDescription "Microsoft Word document" .doc
AddDescription "GZIP compressed TAR archive" .tgz .tar.gz
AddDescription "GZIP compressed archive" .Z .z .gz .zip
AddDescription "Plain text file" .txt .nfo .faq .readme
AddDescription "Win32 compressed HTML help" .chm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment