Forum Discussion
Sams_88783
Nimbostratus
Aug 23, 2010Please help in converting v4.x irule to 9.x
Hello,
I tried to convert the below 4.x irule to 9.x but i am getting error.Please help me in converting the same.
if (http_host == "mydomian.com" and http_header("WL-Proxy-...
Aug 26, 2010
This should work. Probably not optimal, but it's the same logic
when HTTP_REQUEST {
if { ([HTTP::host] eq "mydomain.com") && ![HTTP::header exists "WL-Proxy-SSL"] } {
HTTP::redirect "https://mydomain.com[HTTP::uri]"
} elseif { ([HTTP::host] eq "mydomain.com") && ([HTTP::uri] ends_with "/") } {
HTTP::redirect "https://mydomain.com/index.html"
} elseif { ([HTTP::host] eq "www.mydomainone.com") && ([HTTP::uri] ends_with "/") } {
HTTP::redirect "https://www.mydomainone.com/index.html"
} elseif { ([HTTP::host] eq "mydomainone.com") && ([HTTP::uri] ends_with "/") } {
HTTP::redirect "https://mydomainone.com/index.html"
} elseif { ([HTTP::host] eq "mydomainone.com") && ![HTTP::header exists "WL-Proxy-SSL"] } {
HTTP::redirect "https://www.mydomainone.com[HTTP::uri]"
} elseif { ([HTTP::host] eq "www.mydomainone.com") && ![HTTP::header exists "WL-Proxy-SSL"] } {
HTTP::redirect "https://www.mydomainone.com[HTTP::uri]"
} elseif { [HTTP::host] eq "192.160.1.1" } {
discard
} else {
pool MYDOMAIN
}
}I'm almost positive we can optimize it but I'll have to dig through it to see how the logic flows and make sure all the cases are covered.
Hope this helps...
-Joe
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
