Forum Discussion

Nilendu's avatar
Nilendu
Icon for Nimbostratus rankNimbostratus
Jun 05, 2019

Need iRule for URL redirection with part of URI as dynamic

I am looking for an iRule such as

 

https://www.abc.com/cat/dog/tiger.aspx with "anything" after that should redirected as https://www.xyz.com//cat/dog/tiger with "anything" after that.

 

Example:

https://www.abc.com/cat/dog/tiger.aspxqqqqqqqqqqrrrrrrrrrr

https://www.xyz.com//cat/dog/tigerqqqqqqqqqqrrrrrrrrrr

 

 

Example:

https://www.abc.com/cat/dog/tiger.aspxqqqqqqqqqqrrrrrrrrrr/mmmmmnnnnn/yyyyy

https://www.xyz.com//cat/dog/tigerqqqqqqqqqqrrrrrrrrrr/mmmmmnnnnn/yyyyy

9 Replies

  • use this irule :

    when HTTP_REQUEST {
      if {[HTTP::host] equals "www.abc.com" && [HTTP::path] equals "/cat/dog/tiger.aspx"} {
        HTTP::redirect "https://www.xyz.com//cat/dog/tiger[HTTP::query]"
      }
    }
    • Stanislas_Piro2's avatar
      Stanislas_Piro2
      Icon for Cumulonimbus rankCumulonimbus

      Devcentral is not a support but a forum with most of contributors who are not F5 employee!!!

       

      please don’t say anymore you are still waiting, this is annoying and nobody will answer anymore!

       

      the url you provided ends with aspx. What is the real end of the url???

    • JRahm's avatar
      JRahm
      Icon for Admin rankAdmin

      Stanislas is correct, Nilendu. These forums are here for F5 employees, customers, partners, and other interested parties to help each other and exchange ideas, but there is no support agreement in place. This is a community where hopefully we can encourage each other and have patience with gratitude that there are others willing to contribute to our journeys.

       

      If you need immediate assistance, you can open a support case with F5 support and if it is not an issue that support can directly address for you, you can inquire with professional services.

  • I apologize for my comments, and thank you all very much for all the helps I received from you guys over the years.