HTTP to HTTPS redirect with URI editing.
Hi,
I am looking for HTTP (internal server) to HTTPS (external server) redirect.
link for internal server : http://abc.com/IT/Team/Data/ external link : https://xyz.com/location/Data/
I tried creating redirect using policy with following action
Target : http-reply Event : request Action : redirect Parameter : location https://xyz.com[HTTP::uri]
This works only if URI in original and redirected site is same as shown bellow
link for internal server : http://abc.com/IT/Team/Data/ external link : https://xyz.com/IT/Team/Data/
But in my case traffic get redirected using URL https://xyz.com/IT/Team/Data/
How I can update URI in redirected link so that it replace /IT/Team/ from URI to /location/
Ok got the solution following rule works.
when HTTP_REQUEST { if {[HTTP::uri] contains "/IT/Team/"} { set uri [string map {"/IT/Team/" "/location/"} [HTTP::uri]] HTTP::redirect "https://xyz.com$uri" } }