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:
-
If the configured redirect URL contains only the domain name, such as <http://www.sample1.example.com>, the redirect URL specified in the HTTP response appends the Uniform Resource Identifier (URI). It is specified in the HTTP request to the configured domain name. For example, if the request contains the GET <http://www.sample2.example.com/images/site_nav.gif> header, then the location header in the redirect response specifies the location: <http://www.sample1.example.com/images/site_nav.gif> header.
The domain names in the request and response can differ. In this topic, the two domains are referred to as sample1.example.com and sample2.example.com to explain the concept.
-
If the configured redirect URL contains a complete path, then the redirect response specifies the complete configured URL, irrespective of the URI in the request. For example, the following are such URLs:
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> |
-
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.