Forum Discussion

Aviv's avatar
Aviv
Icon for Cirrus rankCirrus
Jan 20, 2016

Redirect any request that ask for a page name contains

Hi !

 

i need to redirect any request that ask for a page name contains TestForm.aspx to google.com

 

i have tried this irule ,but it is not working for me:

 

when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "TestForm" } { HTTP::redirect "www.google.com" } }

 

That wrong? how can i do it?

 

Thanks, Aviv Hassidim

 

2 Replies

  • Hi Aviv,

    if

    [string tolower]
    is used for the given input, then you have to compare the outcome using lower case conditions... 😉

    when HTTP_REQUEST { 
        if { [string tolower [HTTP::uri]] contains "testform.aspx" } then { 
            HTTP::redirect "www.google.com" 
        } 
    }
    

    Cheers, Kai