Apache Today: Web Automation: Generating Dynamic Tables of Contents | Linux Today

Apache Today: Web Automation: Generating Dynamic Tables of Contents

Written By
Web Webster
Web Webster
Jun 21, 2000

[ Thanks to Kevin
Reichard
for this link. ]

“In my last article, I described how to make a Dynamic Directory
Index using a Perl CGI. … This is nice if you have a hierarchical
Web directory structure and want to strategically place these CGIs
in high-traffic or frequently added/updated areas. But what if you
want a table of contents that listed every index.html page? By
slightly modifying our script from last time, we can turn our
one-deep directory index, into a full-blown table of contents
generator–and even a search engine, with a little
ingenuity.”

“Apache is pretty much ready to go if you want to implement
these features. You might want to change the AddHandler directive
for cgi-script, as I have demonstrated below, and turn on ExecCGI
for whatever directory you have this script housed:

AddHandler cgi-script .pl .cgi

“…here’s what this script needs to do (condensed a bit):

  1. Obtain a list of directories
  2. For every directory, open the index.html file and extract the
    title of the page
  3. Print back the title, with a link to the page
  4. Dive into the directory, and back to Step 1″

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.