Forum Discussion
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
- Cory_50405
Noctilucent
So what else changed between the time you had it working and now? Different testing FQDN? Anything?
- cjones_01_13155
Nimbostratus
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]]" } } - cjones_01_13155
Nimbostratus
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
- Cory_50405
Noctilucent
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?
- Matt_Breedlove_
Nimbostratus
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_
Nimbostratus
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"
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com