Forum Discussion
f5now_28704
Apr 27, 2009Nimbostratus
HTTP::uri slim down the irule
hey guys, currently I have an irule with redirects for some states/cites...long...is there a way of making it smaller...some sort of find and replace.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] eq "/oregon-auto-equity-loans.aspx" } {
HTTP::redirect "/phoenix-auto-equity-loans.aspx"
}
if { [string tolower [HTTP::uri]] eq "/oregon-auto-title-loans.aspx" } {
HTTP::redirect "/phoenix-auto-title-loans.aspx"
}
if { [string tolower [HTTP::uri]] eq "/oregon-car-title-loans.aspx" } {
HTTP::redirect "/phoenix-car-title-loans.aspx "
}
if { [string tolower [HTTP::uri]] eq "/illinois-cash-car-title-loans.aspx" } {
HTTP::redirect "/los-angeles-cash-car-title-loans.aspx"
}
something to find anything "oregon" and swapit with "phoenix" also "illinois" to "los-angeles"
- The_BhattmanNimbostratus
- hooleylistCirrostratusMaybe something like this?
when HTTP_REQUEST { Check if request contains either "find" string switch [string tolower [HTTP::path]]}{ "oregon" - "illinois" { HTTP::redirect "http://[HTTP::host][string map {oregon phoenix illinois los-angeles} [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