Forum Discussion
cxcal_18687
Nimbostratus
Jan 25, 20114.xto 10.x iRules
Is there any clean way of converting 4.x iRules to 10.x ?
Any help would be appreciated.
rule attnow {
redirect to "https://%h/%u"
}
rule...
Colin_Walker_12
Jan 25, 2011Historic F5 Account
There isn't any tool to do the conversion, no, but try these:
rule attnow {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
rule actt_redirect {
if {[HTTP::uri] == "/" } {
HTTP::redirect "https://inc.com/actt"
} else {
HTTP::redirect "https://inc.com/[HTTP::uri]"
}
}
rule MEVSNET {
switch -glob [HTTP::host] {
"*.inc.com" {
if {[HTTP::header exists "WL-Proxy-SSL"]} {
HTTP::redirect "https://inc.com/[HTTP::uri]"
} elseif {[HTTP::uri] ends_with "/"} {
HTTP::redirect "https://inc.com/index.html"
}
}
"*.snet.com" {
if {[HTTP::header exists "WL-Proxy-SSL"]} {
HTTP::redirect "https://www.snet.com/[HTTP::uri]"
} elseif {[HTTP::uri] ends_with "/" } {
HTTP::redirect "https://www.snet.com/index.html"
}
}
"192.199.99.104" { discard }
default {
pool SNET
}
}
}
rule Direct {
if {[HTTP::header exists "WL-Poxy-SSL"]} {
if {([HTTP::uri] ends_with "router/t_fileupload") or ([HTTP::uri] ends_with "router/p_fileuplaod"} {
HTTP::redirect "https://inc.com/router/t_fileupload"
return
}
} else {
if {([HTTP::uri] ends_with "router/t_fileupload") or ([HTTP::uri] ends_with "router/p_fileuplaod"} {
HTTP::redirect "http://inc.com/router/error"
return
} elseif {[HTTP::uri] ends_with "/"} {
HTTP::redirect "https://inc.com/edidirect"
return
} else {
HTTP::redirect "https://192.199.99.107/[HTTP::uri]"
return
}
}
pool Direct
}
Those aren't all tested so they may need a little tweaking, but they should get you close.
Colin
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