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, thehttp://example.comURL is not the same as thehttp://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

  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

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

  1. Navigate to交通管理> >负载均衡虚拟服务ers.

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

  3. 编辑一个existing virtual server, select the virtual server from the list and clickEdit.

  4. On theAdvanced Settingstab, clickProtection. In theRedirect URL字段中,输入重定向URL(例如,http://www.newdomain.com/mysite/maintenance).

    Protection redirect URL

    Redirect URL field

  5. ClickOK.

Redirect client requests to an alternate URL