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

cjones_01_13155's avatar
cjones_01_13155
Icon for Nimbostratus rankNimbostratus
Jun 12, 2014

Lowercase URI

Below I have the current rule setup: when HTTP_REQUEST {

Check for capital letters in string if {[string match {[A-Z]} [HTTP::path]]}{

  HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]][HTTP::query]" 

} }

This is working and converting the string to all lowercase. I want the rule to only do pages or strings that end in .aspx?

Can this be done

47 Replies

  • So what else changed between the time you had it working and now? Different testing FQDN? Anything?

     

  • ok so this rule is changing the URL to lowercase.

    when HTTP_REQUEST {
    
        Check if the URI has any capitalized letters
       if {[string match {*[A-Z]*} [HTTP::uri]]}{
          HTTP::redirect "http://[HTTP::host][string tolower [HTTP::uri]]"
       }
    }
    
  • But the get on the rest of the page. http://stg.sp10.shrm.org/_layouts/1033/styles/Themable/corev4.css?rev=p63%2BuzTeSJc22nVGNZ5zwg%3D%3D

     

    is returning a 302 instead of 200. THat is why I only wanted to do ends_with .aspx

     

  • So that 302 is coming back from the server. Where is it attempting to redirect to? An outside resource, or another location on the same resource?

     

  • Hey Cjones,

    This should work. Let me know if it does what you need.

    
    if { not ([HTTP::path] equals [string tolower [HTTP::path]]) && [HTTP::path] ends_with ".aspx"  }
       HTTP::redirect "http://[HTTP::host][string tolower [HTTP::path]][HTTP::query]" 
    } 
    

    • Matt_Breedlove_'s avatar
      Matt_Breedlove_
      Icon for Nimbostratus rankNimbostratus
      You might want to add a [string tolower] on the HTTP::path for the .aspx evaluation...if you want .ASPX, .aSpX, etc to match as well as ".aspx"