Installation guide

Chapter 14. Apache HTTP Server 199
See Section 14.5.59 and Section 14.5.23 for instructions on how to execute CGI scripts in directories
other than the cgi-bin.
14.5.45. Redirect
When a webpage is moved, Redirect can be used to map the old URL to a new URL. The format is
as follows:
Redirect /path/foo.html http://new_domain/path/foo.html
So, if an HTTP request is received for a page which used to be found at
http://your_domain/path/foo.html, the server will send back the new URL
(http://new_domain/path/foo.html) to the client, which should attempt to fetch the document
from the new URL.
For more advanced Redirection you can use the mod_rewrite module included with the server.
14.5.46. IndexOptions
IndexOptions controls the appearance of server generated directing listings, by adding icons, file
descriptions, and so on. If Options Indexes is set (see Section 14.5.24), your Web server may
generate a directory listening when your Web server receives an HTTP request like the following:
http://your_domain/this_directory/
First, your Web server looks in that directory for a file from the list after the DirectoryIndex
directive (usually, index.html). If your Web server does not find one of those files, it creates an
HTML directory listing of the subdirectories and files in the directory. You can modify the appearance
of this directory listing using certain directives in httpd.conf, including IndexOptions.
Your default configuration sets FancyIndexing on. If FancyIndexing is turned on, clicking on the
column headers in the directory listing will sort the order of the display by that header. Another click
on the same header will switch from ascending to descending order and back. FancyIndexing also
shows different icons for different files, depending upon file extensions. If you use the AddDescrip-
tion directive and turn FancyIndexing on, then a short description of a file will be included in the
server generated directory listing.
IndexOptions has a number of other parameters which can be set to control the appearance of server
generated directories. Parameters include IconHeight and IconWidth, to make the server include
HTML HEIGHT and WIDTH tags for the icons in server generated webpages; IconsAreLinks, for
making the icons act as part of the HTML link anchor along with the filename and others.
14.5.47. AddIconByEncoding
This directive names icons which will be displayed by files with MIME encoding, in server generated
directory listings. For example, by default, your Web server shows the compressed.gif icon next
to MIME encoded x-compress and x-gzip files in server generated directory listings.
14.5.48. AddIconByType
This directive names icons which will be displayed next to files with MIME types in server generated
directory listings. For example, your server is set to show the icon text.gif next to files with a
mime-type of "text," in server generated directory listings.