Forum Discussion
kraigk_52257
Nimbostratus
Jul 01, 2015Inefficient iRule, works but not perfect
We have a working iRule that I'm sure can be improved/. The first section is simple redirects from domain.org URL to equivalent https domain.com URL. We discovered that if users browsed directly to...
Stanislas_Piro2
Cumulonimbus
Jul 01, 2015Use the switch statement instead of if and use variable if possible...
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"team.domain.org" { HTTP::redirect "https://team.domain.com[HTTP::uri]"}
"site1.domain.org" { HTTP::redirect "https://site1.domain.com[HTTP::uri]"}
"site2.domain.org" { HTTP::redirect "https://site2.domain.com[HTTP::uri]"}
"myteam.domain.org" { HTTP::redirect "https://myteam.domain.com[HTTP::uri]"}
"site1.domain.com" -
"site2.domain.com" -
"team.domain.com" -
"myteam.domain.com" { https://[HTTP::host]/default.aspx[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