Skip to main content
Version: v7

KB: 2006

How to redirect an HTTP request to another site or URL?

Problem Statement I

The client wants to redirect its HTTP sites to the HTTPS site temporarily.

Solution

The client can achieve the above requirement by utilizing the redirection Rule feature of the SLB.

  1. Login into Haltdos console.

  1. Go to Apps > SLB > Listeners > Rules > Redirection rule > Add rule > Save changes.

  1. The below image is showing when the redirection rule is not implemented.

  1. The below image is showing the temporary redirection of HTTP site to HTTPS site through the redirection rule.

  1. As client can observe, the redirection rule in SLB is temporarily redirecting traffic that is coming on HTTP site to HTTPS site with the status code of 302, as per the settings made in the redirection rule.

Problem Statement II

The client wants to redirect its HTTP sites to the HTTPS site permanently.

Solution

Steps to solve:-

  1. The above scenario can be achieved by setting the redirection rule with the response code of 301 : Permanent Redirect

  1. As client can observe, they are getting the expected response with status code 301, as per the set configuration.

Note: Please ensure to clear your cached data from browser to revert back from permanent redirect, as a local copy gets saved in cache, and will keep redirecting even if the rule is deleted from the SLB GUI.