Redirect

From Secure Web Gateway
Revision as of 17:39, 4 January 2023 by Pratik (talk | contribs) (→‎Example)

Overview

Create policies to redirect requests for a URL to another URL.

You may create redirection policies that intelligently fetch response from a desired URL, and serve it to the client.

Alternatively, you may create policies that respond with a HTTP 302 redirection that instructs the client to seek your suggested URL.

Access The SafeSquid User Interface

Go to Configure Page

Google Safe search1.png  

Go to Real time content Security

Google Safe search4.png

 

Go to Redirect Section

Google Safe search5.png

 

Global

Enabled

Enable or Disable URL Redirection.

  • TRUE : Enable URL redirection.
  • FALSE : Disable URL redirection.

Google Safe search6.png

Google Safe search7.png

Google Safe search8.png

Google Safe search9.png

 

Redirection policies

Google Safe search10.png

 

Check Default entry in Redirection Policies

Google Safe search11.png

 

Add new policy (if you want to create new policy click on add button)

Redirect-policies.jpg

 

Create Entries to setup your URL Redirection Policies.

First entry applicable for a connection is used, skipping the rest.

Disabled Entries are ignored.

Enabled

Enable or Disable this entry

  • TRUE : Enable this entry.
  • FALSE : Disable this entry.

Comment

For documentation, and future references, explain the relevance of this entry with your policies.

That is, by reading the policies, a future user can understand the purpose of that entry.

Profiles

Specify the Profiles applicable for this entry.

This entry will be applicable only if the connection has any one of the specified profiles.

Leave it Blank, to apply for all connections irrespective of any applied profile.

To avoid application to a connection that has a profile, use negated profile (!profile).

URL

Specify the requests to redirect.

This should be a valid PCRE (Perl Compatible Regular Expression).

Redirection occurs only if the requested URL matches this PCRE.

A typical URL is in the form "protocol://host/file".

Redirect

Specify the URL to redirect the request to.

A typical URL is in the form "protocol://host/file".

If left blank, the request will neither be redirected to any URL nor be connected to the requested URL, thus leaving the request never served.

Port

Specify the port to redirect the request to.

If left blank, the request will be redirected to the port available in the original request.

302 Redirect

If yes, a 302 redirect is issued; otherwise the new host is connected directly and the new file is requested.

A 302 redirect should always be used when possible to ensure relative links and images are correct.

  • TRUE : Enable 302 redirect.
  • FALSE : Disable 302 redirect.

Options

Several options are available to control how the URL should be handled.

  • ENCODE : Encode the new URL.
  • DECODEBEFORE : Decode the URL before attempting to match it with the regular expression.
  • DECODEAFTER : Decode the new URL after matching.

Applies to

Specify whether the URL to be redirected is the actual request from the user or part of the Location header returned by the requested site.

  • URL : Redirect if the URL is part of the actual request.
  • LOCATION : Redirect if the URL is part of the location header.
  • BOTH : Redirect if the URL is part of either actual request or Location header.

Follow below link for more understanding

How to enforce SafeSearch