Redirect Policy to Keep the Original URL Path and Query
search cancel

Redirect Policy to Keep the Original URL Path and Query

book

Article ID: 165807

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

This article describes the method for creating a rule to redirect traffic, via the proxy "Return Redirect" policy object, while retaining the original URL path and related queries.

Resolution

VPM (Visual Policy Manager) Example

  1. Add a Web Access Layer
  2. Set the Destination to the URL that needs to be redirected
  3. In Action, set a new Return Redirect Object
  4. Enter a name for the Object and the Response Code.
  5. Enter the value for the URL that it is going to be redirected to.
  6. Click Ok,  and install the policy.

 

CPL (Content Policy Language) Example


Allow url.domain=http://ReplaceWithURLToBeRedirected.com action.ReturnRedirect1(yes)

define action ReturnRedirect1
request_redirect(302,".*","https://URLToBeRedirectedTo.com")
end

Note(s):

  • When specifying the URL in the "Return Redirect" object, the protocol scheme (HTTP or HTTPS) must be specified (otherwise the page will not load).
    • Example: https://google.com or http://192.168.10.10
  • You can also specify an IP address instead of the URL