Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: Header Management
- Next: Using Servlets

## Redirecting URLs

You can specify that a request for an old URL is treated as a request for a new URL. This is called redirecting a URL.

To specify a redirected URL for a virtual server, use the `redirect_`n property, where n is a positive integer that allows specification of more than one. This property is a subelement of a `virtual-server` element in the `domain.xml` file. For more information about this element, see `virtual-server` in Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Administration Reference. Each of these `redirect_`n properties is inherited by all web applications deployed on the virtual server.

The value of each `redirect_`n property has two components, which may be specified in any order:

The first component, `from`, specifies the prefix of the requested URI to match.

The second component, `url-prefix`, specifies the new URL prefix to return to the client. The `from` prefix is simply replaced by this URL prefix.

For example:

    <property name="redirect_1" value="from=/dummy url-prefix=http://etude"/>

- Previous: Header Management
- Next: Using Servlets

- © 2010, Oracle Corporation and/or its affiliates