Forum Discussion

Jaswinder's avatar
Jaswinder
Icon for Nimbostratus rankNimbostratus
Nov 04, 2019

irule for replacing URI

 

We have a url https://xyz.com/abc/default.aspx which is working fine at the moment. But when we put an irule to replace URI of any of the legacy URLs which doesn't start with "/abc" with "/abc/default.aspx" then https://xyz.com/abc/default.aspx stops working. Below is the irule that we have used. Also, we tried several variations of irule, even using redirect to https:// https://xyz.com/abc/default.aspx when URI doesn't start with "/abc" but it keeps breaking the original website.

 

 

when HTTP_REQUEST {

 if { not ([HTTP::uri] starts_with "/abc") } {

  HTTP::uri "/abc/default.asp"

 }

}

 

Can someone please advice what changes should be made to the irule to get it working. Thank you.

2 Replies

  • Hi Jaswinder,

    HTTP::uri "/abc/default.asp"

    ​​Can you change this line with:

    HTTP::uri "/abc/default.aspx"

    ​Other than that, iRule looks right.

  • Hi, the page is actually at default.asp and not default.aspx. I am not sure where to look further to fix the issue, I have tried to do the uri replacement with a policy too and end up getting the same result where the original page stops working as soon as the irule or policy is applied for uri replacement.