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

hamishhound_199's avatar
hamishhound_199
Icon for Nimbostratus rankNimbostratus
Apr 29, 2015

iRule redirect

I would like to do the following redirect via an iRule.

Redirect * to *

I have created the following iRule and added to the VS resources but it does not work. Any help would be appreciated as I am a total novice here!

when HTTP_REQUEST { if { [HTTP::host] starts_with "ensemble-sp1/" && [HTTP::uri] contains "/sites/PMIS/*"} {

      HTTP::redirect "http://cindy-uat/*[HTTP::uri]" 

} }

1 Reply

  • You can try something like this:

    when HTTP_REQUEST { 
        if { ([string tolower [HTTP::host]] starts_with "ensemble-sp1") && ([string tolower [HTTP::uri]] contains "/sites/PMIS/" ) } { 
             the following command will find the string /sites/PMIS/ and will return all characters after 
             that string until it hits either an & or the end of the string,
            HTTP::redirect "http://cindy-uat/[findstr [HTTP::uri] "/sites/PMIS/" 12 &]"
        }
    }
    

    I haven't actually tested this, but it should be a good starting point for you.