Forum Discussion

marlon_Gino-gi1's avatar
marlon_Gino-gi1
Icon for Nimbostratus rankNimbostratus
Feb 11, 2008

Irules Redirect not working if you change case on the filename

hello,

 

 

would like to know if redirects configured on the F5 are case sensitive when the redirect is made at the file level?

 

 

 

 

As an example:

 

 

 

 

A redirect of the page: https://www.test.com/Pages/TEST.aspx to https://www.test.com/Pages/TEST1.aspx will work. But if you try to use the redirect by changing the case of the file name it will not work (…../Pages/test.aspx).

 

 

Is there any Irules redirect that would handle all case possibilities?

 

 

3 Replies

  • Hi,

     

     

    you can try to use "toupper", it will convert the string to upper case. following is the sample,

     

     

    when HTTP_REQUEST {

     

    if { [string toupper [HTTP::uri]] contains "test.aspx" } {

     

    HTTP::redirect "https://www.test.com/Pages/TEST1.aspx"

     

    }

     

    }

     

     

    regards,

     

    KY

     

  • Hi,

     

     

    you can try to use "toupper", it will convert the string to upper case. following is the sample,

     

     

    when HTTP_REQUEST {

     

    if { [string toupper [HTTP::uri]] contains "TEST.aspx" } {

     

    HTTP::redirect "https://www.test.com/Pages/TEST1.aspx"

     

    }

     

    }

     

     

    regards,

     

    KY

     

  • As KY suggests, you can use the string toupper (or string tolower) command to change the case of a string. It would be good to change the entire case of the string you're making the comparing with:

     

     

    if {[string tolower [HTTP::path]] ends_with "/test.aspx"}{

     

     

    or

     

     

    if {[string toupper [HTTP::path]] ends_with "/TEST.ASPX"}{

     

     

    Aaron