cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

redirect http to https URI

Hoang_Hung
Altostratus
Altostratus

Hi all

How do you do redirect uri : redirectURL=http://pcmuat-bo.ena.com:80/ARXAL/AALIndex.jsp&userType=Cop change to redirectURL=https://pcmuat-bo.ena.com:80/ARXAL/AALIndex.jsp&userType=Cop

Example:

https://pcmuat-bo.ena.com/ARXAuth/LoginScreen.jsp?redirectURL=http://pcmuat-bo.ena.com:80/ARXAL/AALIndex.jsp&userType=Cop

--------------------------------------

Redirect

https://pcmuat-bo.ena.com/ARXAuth/LoginScreen.jsp?redirectURL=https://pcmuat-bo.ena.com/ARXAL/AALIndex.jsp&userType=Cop

 

Thanks all

4 REPLIES 4

Hi Hoang Hung,

 

Can you try this?

when HTTP_REQUEST { if { [HTTP::uri] starts_with "/ARXAuth/LoginScreen.jsp?redirectURL=http://" } { set uri [string map -nocase {"http://" "https://"} [HTTP::uri]] HTTP::redirect "https://[HTTP::host]$uri" } }

 

Hi Eaa

We have try test. it redirected ok.

But I so sorry. We would like Redirect:

https://pcmuat-bo.ena.com/ARXAuth/LoginScreen.jsp?redirectURL=https://pcmuat-bo.ena.com: 443/ARXAL/AALIndex.jsp&userType=Cop

After apply irule

https://pcmuat-bo.vietcombank.com.vn/ARXAuth/LoginScreen.jsp?redirectURL=https://pcmuat-bo.vietcombank.com.vn:80/ARXAL/AALIndex.jsp&userType=Bank

We hope that it will change port to 443 for URI

 

How do you do for solution ?

 

Thanks Eaa

 

Hi,

when HTTP_REQUEST { if { [HTTP::uri] starts_with "/ARXAuth/LoginScreen.jsp?redirectURL=http://" } { set urifirst [string map -nocase {"http://" "https://"} [HTTP::uri]] set urilast [string map -nocase {":80/" ":443/"} $urifirst] HTTP::redirect "https://[HTTP::host]$urilast" } }

 

Thank Eaa

Thanks you. We will try it and reply to your.

Thanks you so much