Forum Discussion
debo_nair_57395
May 23, 2012Nimbostratus
String replace question on [HTTP::path] help !!
Folks
sorry if this is too simple of a question to ask but I just started on irules a few months back.
I have [HTTP::path] = /intl/es_US/hotels/hotelsLanding and want to replace the first 11 characters with /es-us/ and append hotels/hotelsLanding to it.
Would the following work ?
"/intl/es_US*" {
set replace_path [string replace [HTTP::path] 0 11 "/es-us/"]
}
Would the value of ${replace_path} be /es-us/hotels/hotelsLanding ? If not how can I get the right value.
TIA.
- Michael_YatesNimbostratusHi debo_nair,
when HTTP_REQUEST { if { [string tolower [HTTP::path]] starts_with "/abc" } { HTTP::redirect [string map {"abc" "def"} [HTTP::uri]] } }
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