Forum Discussion

Mostafa_Elsayed's avatar
Jun 24, 2021

IRULE to redirect HTTP response port

i want to create IRULE to make port redirection to my VIP port at HTTP response.

 

Website_VIP : 10.1.1.200:2006

and when i access this website , it redirects me to "10.1.1.200:2006" with HTTP Response code 302, but this vip isn't exist, so i want to create irule to redirect me again to my VIP.

3 Replies

  • Hi,

     

    i think i got what you want look here is an irule example in case of redirection (302):-

     

    when HTTP_RESPONSE { if {[HTTP::status] == "302" } 

    { HTTP::header replace Location [string map {"myserver.domain:4443" "myserver.domain"}[HTTP::header Location]] }}

     

     

  • You haven written well your question and I don't get what you want, still I see that you have many posts for basic irules so I recommend taking the F5 course "Developing iRules for BIG-IP"

     

    https://www.f5.com/services/training/training-courses-and-classes/developing-iRules-for-BIG-IP

     

     

    You can also review the free comunity resources:

     

     

    https://devcentral.f5.com/s/articles/irules-101-01-introduction-to-irules