Forum Discussion
Grayson_149410
Nimbostratus
Jan 26, 2015iRule Different HTTP Response and lower string
I have the following iRule that works great for 302 to 301 redirects and lowers the uri. The problem I am running into now that if it returns a status other than 302 (for example a simple 200 ret...
Michael_Jenkins
Cirrostratus
Jan 26, 2015Can I ask what your use case is for lowercase uri? If you only care about the uri on the serverside, then you can just do this:
when HTTP_REQUEST {
HTTP::uri [string tolower [HTTP::uri]]
}
If you need the client to see the lowercase URI in their browser, then you'll need to issue a redirect in the
HTTP_REQUEST event. However, you'll run into issues if it's not a GET request (i.e. if a POST is made). In the case of a GET, you could do this:
when HTTP_REQUEST {
if { ([HTTP::method] equals "GET") && not ([string tolower [HTTP::uri]] equals [HTTP::uri]) } {
HTTP::redirect [string tolower [HTTP::uri]]
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects