Forum Discussion

pmsivaraj_34123's avatar
pmsivaraj_34123
Icon for Nimbostratus rankNimbostratus
Dec 04, 2017

Replace Part of the Path in URL using LTM Policy

Hi,

 

I have created LTM Policy(Local Traffic>>Policies>>Policy List) to replace a part in the URL.

 

Requested URL: https://www.test.com/xyz/rst/change_for/test/index.refresh

 

Replace /rst/change_for/ with /address/

 

Expected Request from F5 to backend server is: https://www.test.com/xyz/address/test/index.refresh

 

How do we achieve this through LTM Policy I tried few options As per the attachment, but it did not work.

 

Note: I need to achieve this through only LTM Ploicy( Not through iRule), also we have to replace a part(redirect should not happen)

 

Thanks, Siva.

 

3 Replies

  • RH's avatar
    RH
    Icon for Nimbostratus rankNimbostratus

    We are facing the same challenge, if anyone can look into this, will be much appreciated.

     

  • Hi,

     

    Have you tried to replace the complete path instead of just a part of the path?

     

    So replace /rst/change_for/test/index.refresh with /address/test/index.refresh

     

    Regards, Martijn

     

  • RH's avatar
    RH
    Icon for Nimbostratus rankNimbostratus

    Hi Martijn,

     

    Thank you for your comment, we have created a new case, as this case is old and our situation is a little different.

     

    https://devcentral.f5.com/questions/replace-part-of-a-url-path-using-ltm-policy-60950

     

    In response to your question; The URL can change, so in our case, there are dates in the complete URL. So what ever comes after the parts we need to look for and change, needs to stay intact. Otherwise we could indeed do a complete rewrite of the URI.