Forum Discussion
demmo_251289
May 31, 2016Nimbostratus
redirect for uppercase URI
Hello, I have a issue with a redirect, part of the URI is uppercase /something/somethingelse/NEW/index.html, and I'd like to redirect to lower /something/somethingelse/new/index.html
Now, if I d...
- May 31, 2016
If you know which part of the uri is uppercase, you can change the if condition like below :
when HTTP_REQUEST { if { [HTTP::path] contains "/NEW/"} { HTTP::redirect [string tolower [HTTP::uri]] } }
Yann_Desmarest
May 31, 2016Cirrus
Hi,
can you try this one, the redirect issue should be fixed :
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] contains "/new/" and [URI::query redirect] eq "" } {
if { [HTTP::uri] contains "?" } {
HTTP::redirect [string tolower [HTTP::uri]]"&redirect=1"
} else {
HTTP::redirect [string tolower [HTTP::uri]]"?redirect=1"
}
}
}
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