Forum Discussion

XITO_122925's avatar
XITO_122925
Icon for Nimbostratus rankNimbostratus
Jun 26, 2013

iRule URL Redirect

I have a problem and hope someone can help me. I have a use cas for one or two iRules.

 

The URL domain.com/member and domain.com/account must be always redirected from http to https. I have created a iRule for the port 80 vip and it works fine. In the member area (Port 443) are diferend buttons. The buttons call HTTPS URLs. The developer cannot change the URL of the button. Because of that, I need a iRule that can redirect all of the URLs that don’t contain “member” to http.

 

I have tried tre iRule for the 443 vip, but I dosent work:

 

iRule for port 80 vip (works):

 

when HTTP_REQUEST {

 

if { [HTTP::uri] contains "/member/"} {

 

HTTP::redirect "https://[HTTP::host][HTTP::uri]"

 

}

 

elseif { [HTTP::uri] contains "/account/"} {

 

HTTP::redirect "https://[HTTP::host][HTTP::uri]"

 

}

 

}

 

iRule for 443 vip (doesn’t work)

 

 

when HTTP_REQUEST {

 

if { not ([HTTP::uri] contains "/member/") } {

 

HTTP::redirect "http://[HTTP::host][HTTP::uri]"

 

}

 

}

 

After deploying the iRule to the 443 vip, the member area will not be displayed be (Browser Error).anyone have an idea?

 

1 Reply

  • Are you terminating the SSL on the F5 or simply passing the SSL traffic through the F5? The reason being is that if you are not terminating the SSL Traffic on the F5, iRules will not have way to look into the encryption to allow you perform the redirect.

     

    I hope this helps,

     

    -=Bhattman=-