Option 1: 302 Redirects

302 Redirect Logic

When the client connects to www.domain.com, the LoadMaster sends a 302 redirect to the client and tells the client to connect to the new domain. This is also used for redirecting HTTP to HTTPS. With this option, the client sees the change in the browser.

Syntax

In the Virtual Service modify screen: Advanced Properties -> Not Available Redirection Handling.

Error code: 302 found

Redirect URL: http://www.newdomain.com

or for HTTP to HTTPS: https://%h%s

Replace with Host/Domain: %h

Replace with URL/Directory/Path: %s

Example: %h and %s are replaced with http://www.newdomain.com/test/index.html

Option 2: Rewrite the URL

Logic

Match on host and replace host with new host details. With this option, the client does not see the change in the browser.

Syntax

Rule: Replace Header

Header: Host

Match String: /^www\.domain\.com$/

Replace with: www.newdomain.com

Match field

Start Regex: /

Start Match: ^

Regular text: www

Literal character: \.

Regular text: domain

Literal character: \.

Regular text: com

End Match $

End Regex /