ADC

Redirect client requests to an alternate URL

You can redirect requests to an alternate URL by using an HTTP 302 redirect if a load balancing virtual server of type HTTP or HTTPS goes DOWN or is disabled. The alternate URL can provide information about the status of the server. The configured redirect URL is specified in the location header of the HTTP response. The exact URL specified in the response depends on the following configuration options:

The following table lists the preceding configuration options:

Configured Redirect URL URL in HTTP Request Header in HTTP Response
http://www.sample1.example.com http://www.sample2.example.com/en/index.html http://www.sample1.example.com/en/index.html
http://www.sample1.example.com/en/error.html http://www.sample2.example.com/en/index.html http://www.sample1.example.com/en/error.html

Note

  • When configuring a redirect URL, the http://example.com URL is not the same as the http://example.com/ URL, because the latter contains the complete path to the Webroot path, /.

  • If a load balancing virtual server is configured with both a backup virtual server and a redirect URL, the backup virtual server takes precedence over the redirect URL. A redirect is used only when both the primary and backup virtual servers are DOWN.

To configure a virtual server to redirect the client request to a URL by using the CLI

  1. Create a load balancing virtual server.

    set lb vserver -redirect url

  2. Verify that the redirect URL option is working as expected. Disable the virtual server.

    disable vserver <vserver_name>

  3. Access the website URL from a web browser to verify that the request is redirected as expected. You might have to clear the web browser cache and make a new connection before accessing the website.

  4. Enable virtual server.

    enable vserver <vserver_name>

To configure a virtual server to redirect the client request to a URL by using the GUI

  1. Navigate to Traffic Management > Load Balancing > Virtual Servers.

  2. In the details pane, to add a new virtual server, click Add.

  3. To edit an existing virtual server, select the virtual server from the list and click Edit.

  4. On the Advanced Settings tab, click Protection. In the Redirect URL field, type the redirect URL (for example, http://www.newdomain.com/mysite/maintenance).

  5. Click OK.

Redirect client requests to an alternate URL