LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

How to customize auto index script

LiteSpeed web server suports automatic directory indexing when index file is not present in a directory, and it is more flexible than the indexing feature provided by any other web servers.

LSWS uses an external script to generate the index page on the fly, the default script comes with the installation package is a PHP script, however, you can create your own script with any language you like.

The URI to the auto index script is configurable by field “Auto Index URI” at virtual host level under general tab. Whenever a directory with no index file is accessed, LiteSpeed Web server will perform an internal redirect to that URI.

In order to share the script among all virtual hosts, a General Context with URI “/_autoindex/” and Location “$SERVER_ROOT/share/autoindex/” is automatically created for every virtual host. The default PHP script, located at lsws/share/autoindex/default.php, has same Look and Feel as Apache’s mod_autoindex.

Permission is granted to copy and change the default auto index script. Since the default script will be overwritten during every upgrade, you should make a copy of the default.php and change the “Auto Index URI” accordingly.

When you write your own script, just remember that the path to the directory to be indexed is passed to the script in a CGI environment variable: “LS_AI_PATH”. The script can be placed at anywhere you like, but if you want to share it among all virtual hosts, just place it under lsws/share/autoindex/ directory.

 
litespeed/wiki/autoindex.txt · Last modified: 2006/12/05 13:04 by mistwang
 
© Copyright 2003-2007 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.