Sample policy for rewriting a URL in Java script

book

Article ID: 166887

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

How can I rewrite a URL in Java script? Is there any sample policy?

 

Resolution

This sample CPL will rewrite a URL from bbb.com to aaa.com in Java script  which sends from the server IP 10.10.10.x

-----------------------------------------------------------------
define url_rewrite sample
    rewrite_script_substring 'aaa.com' 'bbb.com'
end

define action sample_action
    transform sample
end

define condition urls
    url="10.10.10.x"
end

<Proxy>
    condition=urls action.sample_action(yes)
-----------------------------------------------------------------