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

Kirit_Patel_521's avatar
Kirit_Patel_521
Icon for Nimbostratus rankNimbostratus
Feb 19, 2014

irule not working

I have the following irule and i get syntax errors I dont know what i am missing Basically if someone type www.mathzone.com/blah or anything after www.mathzone.com/ i want to redirect to successinhighered.com/math/

what am i doing wrong?

when HTTP_REQUEST {

   if {([string tolower[HTTP::host]] equals  "www.mathzone.com") and ([string tolower[HTTP::uri]] starts_with "/*") }{

{

HTTP::redirect http://successinhighered.com/math/

}

}

2 Replies

  • Try this:

    when HTTP_REQUEST {
        if { ( [string tolower [HTTP::host]] equals "www.mathzone.com" ) and ( [HTTP::uri] ne "/" ) } {
            HTTP::redirect "http://successinhighered.com/math/"
        }
    }
    

    If I understood you correctly, if the user adds ANY URI at all, you want to redirect them. So

    http://www.mathzone.com does not redirect
    
    http://www.mathzone.com/blah does redirect
    

    Is that correct?

  • so basically if a user types http://www.mathzone.com and anything after the url like www.mathzone.com/joe . so anything after www.mathzone.com/xxx should redirect to

     

    http://successinhighered.com/math/"