Forum Discussion

davelutz's avatar
davelutz
Icon for Nimbostratus rankNimbostratus
Jun 18, 2020

Redirect based on string text from the responce

We have a web application that is out of support and can not be changed at the moment because of cost reduction do to the pandemic. We send customers an email link that points them to the system to make a payment but they are only valid for 12 hours and then they expire. The problem is that once they expire they give a error that the link has expired and then it provides a link to a company we no longer own. What I want to do, if it is possible, is set an iRule that, if it sees "Link Expired" on the responding page, it redirects them to a page we can edit rather then allowing them to click the link to the other company.

 

Any input would be greatly appreciated,

2 Replies

  • when HTTP_RESPONSE {

    HTTP::collect

    }

    when HTTP_RESPONSE_DATA {

    if { [ string first "text to search for" [HTTP::payload] } {

    HTTP::redirect "redirectpage"

    }

    }