iTP Secure WebServer System Administrator's Guide (iTPWebSvr 5.1+)

Configuring the iTP Secure WebServer
iTP Secure WebServer System Administrators Guide522659-001
7-32
Redirecting Access
Redirecting Access
You can use the Redirect command in a Region directive to redirect requests to an
alternate URL. This feature is especially useful when you move server contents (in part
or in whole) to a different host machine. Instead of advertising the new URL, you can
simply redirect requests to it.
The function of the
Redirect command is similar to that of the Filemap command.
Instead of translating a request to a different path, as the Filemap directive does, the
Redirect command directs a request to a different URL.
The Redirect command has a status option that lets you specify whether a file has
moved temporarily or permanently. When a request is satisfied by redirection, the iTP
Secure WebServer reports this status to the client as an HTTP status code.
There are two approaches to redirecting requests to an alternate URL:
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.