Sun Java System Web Server 6.1 SP9 Administrator's Configuration File Reference

redirect

Applicable in NameTrans-class directives.

The redirect function lets you change URLs and send the updated URL to the client. When a client accesses your server with an old path, the server treats the request as a request for the new URL.

Parameters

The following table describes parameters for the redirect function.

Table 4–15 redirect Parameters

Parameter  

Description  

from

Specifies the prefix of the requested URI to match. 

url

(Maybe optional) Specifies a complete URL to return to the client. If you use this parameter, don’t use url-prefix (and vice versa).

url-prefix

(Maybe optional) The new URL prefix to return to the client. The from prefix is simply replaced by this URL prefix. If you use this parameter, don’t use url (and vice versa).

escape

(Optional) Flag that tells the server to util_uri_escape the URL before sending it. It should be yes or no. The default is yes.

For more information about util_uri_escape, see the Sun Java System Web Server 6.1 SP9 NSAPI Programmer’s Guide.

bucket

(Optional) Common to all obj.conf functions.

Examples

In the first example, any request for http://server-name/whatever is translated to a request for http://tmpserver/whatever.


NameTrans fn=redirect from=/ url-prefix=http://tmpserver

         

In the second example, any request for http://server-name/toopopular/whatever is translated to a request for http://bigger/better/stronger/morepopular/whatever.


NameTrans fn=redirect from=/toopopular url=http://bigger/better/stronger/morepopular