For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

ghost-rider_124's avatar
ghost-rider_124
Icon for Nimbostratus rankNimbostratus
Apr 12, 2014

IRULE for Redirect, Append and Rewrite

Hello Experts

 

I want to write irule for below requirement. Please help me out

 

1- http://www.abc.com/ -> https://www.abc.com/test/login.aspx (http to https and append test/login.aspx to www.abc.com/) 2- https://www.abc.com/ -> https://www.abc.com/test/login.aspx (only append test/login.aspx to www.abc.com/) 3- When I access https://www.abc.com/test/login.aspx, there is some link in httpwatch in response that is http://ajax.googleapis.com. I also want to rewrite this response http://ajax.googleapis.com -> https://ajax.googleapis.com

 

Regards,

 

GR

 

2 Replies

  • Number 1 and 2 is pretty straight forward but as for number 3 I would insist on that it was made in the code if I were you.

     

    Changing any references in the code via the load balancer instead of thesource would take up unnecessary resources.

     

    If I understood your question number 1 and two should be covered by this iRule:

     

    when HTTP_REQUEST {
        if { [HTTP::uri] -eq "/" } {
            HTTP::respond 301 location "https://www.abc.com/test/login.aspx"
        }
    }

    /Patrik

     

  • Hi!

     

    You could try the stream feature. Example:

     

    https://devcentral.f5.com/questions/irule-for-rewriting-http-request-with-https-request

     

    /Patrik