iTP Secure WebServer System Administrator's Guide (Version 7.0)
Configuring the iTP Secure WebServer
iTP Secure WebServer System Administrator’s Guide—523346-012
7-35
Redirecting Access
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