Add header footer in directory listing in Apache (httpd)

How to add header footer in directory listing in Apache (httpd)?

In the web directory’s .htaccess file:

Options +Indexes
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8
HeaderName /header.html
ReadmeName /footer.html
IndexIgnore header.html footer.html .htaccess

header.html and footer.html are under the website root directory (not the Linux root).

Answered by Eric Z Ma.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *