iTP Secure WebServer System Administrators Guide (Version 7.5+)

1. You can use a Redirect command to redirect requests to an alternate location that has a
different file structure from that of the original location:
Redirect alt-url
This Redirect command tells the server to redirect a request for a specified object and
specifies a fully qualified alternate URL (alt-url). For example, if you move the HTML
document
/info/stats.html
to
/statsinfo.html
on a different host machine (www.widgets.com), you could use the following Region
directive to redirect requests for this file:
Region /info/stats.html {
Redirect http://www.widgets.com/statsinfo.html
}
In this example, any request for
/info/stats.html
is automatically redirected to the URL
http://www.widgets.com/statsinfo.html
2. You can use a Redirect command with the -replace option to redirect requests to an
alternate location that has the same file structure as the original location:
Redirect [-replace /replace-spec] alt-rl
When you specify the -replace option, the URL path element specified by /replace-spec
is removed from the front of the request URL. The remainder of the request URL is then appended
to the alternate URL (alt-url).
The -replace option is especially useful when you move an entire file structure intact from
one host to another.
For example, you can use the following Region directive to redirect requests for all objects
under directory /info/stocks/* to the new location
http://quote.widgets.com/stocks as follows:
Region /info/stocks/* {
Redirect -replace /info/stocks
http://quote.widgets.com/stocks }
In this example, any request for the object
/info/stocks/quote/dec.html
is redirected to the URL
http://quote.widgets.com/stocks/quote/dec.html
Enabling Automatic Directory Indexing
You can enable automatic indexing for server directories. Under automatic indexing, if a request
corresponds to a directory for which no index file is available, the server automatically generates
one.
To enable automatic indexing, you use the DirectoryIndex command in a Region directive.
For example, this directive enables indexing for all directories on the server:
Region * {
DirectoryIndex
}
This example shows an index generated under automatic directory indexing:
NameLast ModifiedSize
-------------------------------------------------------
Controlling Access to the Server 117